Documentation
¶
Index ¶
- Constants
- Variables
- func NewValidationError(message string, validationError error) error
- type ApiKey
- type ApiKeyRepository
- type App
- type AppId
- type AppRepository
- type AppStatus
- type Deployment
- type DeploymentConfig
- type DeploymentContext
- type DeploymentDoc
- type DeploymentDocker
- type DeploymentRepository
- type DeploymentRevisionStatus
- type DeploymentStatus
- type DeploymentTrafficStatus
- type FakeApiKeyRepository
- type FakeAppRepository
- type FakeDeploymentRepository
- func (f *FakeDeploymentRepository) Create(newDeployment *Deployment) error
- func (fake *FakeDeploymentRepository) FindByApp(appName string) ([]Deployment, error)
- func (f *FakeDeploymentRepository) Get(name, stageName string) (*Deployment, error)
- func (fake *FakeDeploymentRepository) IncrementGeneration(deploymentName, stageName string) (int64, error)
- func (fake *FakeDeploymentRepository) RollbackGeneration(name, stageName string, failedGeneration int64) (int64, error)
- func (fake *FakeDeploymentRepository) UpdateStatus(deploymentName, stageName string, status *DeploymentStatus) error
- func (fake *FakeDeploymentRepository) UpdateTraffic(name, stageName string, riserGeneration int64, traffic TrafficConfig) error
- type FakeSecretMetaRepository
- type FakeStageRepository
- type FakeUserRepository
- type Namespace
- type NewUser
- type ResourceFile
- type RuntimeConfig
- type SecretMeta
- type SecretMetaDoc
- type SecretMetaRepository
- type Stage
- type StageConfig
- type StageDoc
- type StageRepository
- type StageStatus
- type StatusProblem
- type TrafficConfig
- type TrafficConfigRule
- type User
- type UserDoc
- type UserRepository
- type ValidationError
Constants ¶
View Source
const (
LoginTypeAPIKey = "APIKey"
)
Variables ¶
View Source
var ErrNotFound = errors.New("the object could not be found")
Functions ¶
func NewValidationError ¶
NewValidationError creates a ValidationError conditional on the type of error passed in. It is expected that validationError is typically of type ozzo-validation.Errors object, containing a key/value pair of string/errors, but it can be of any type of error that is consumable by a client.
Types ¶
type ApiKeyRepository ¶
type AppRepository ¶
type AppStatus ¶
type AppStatus struct {
StageStatuses []StageStatus
// Deployments returns the whole deployment. We should probably use a different type here with less data, but we can't just pass
// Deployment.Doc.Status as we also need the DeploymentName and the Stage.
Deployments []Deployment
}
type Deployment ¶
type Deployment struct {
Name string
StageName string
AppName string
// RiserGeneration is for tracking deployment changes and has no relation to a k8s Deployment generation
RiserGeneration int64
Doc DeploymentDoc
}
type DeploymentConfig ¶
type DeploymentConfig struct {
Name string
Namespace string
Stage string
Docker DeploymentDocker
// TODO: Move to core and remove api/v1/model dependency
App *model.AppConfig
Traffic TrafficConfig
ManualRollout bool
}
type DeploymentContext ¶
type DeploymentContext struct {
Deployment *DeploymentConfig
Stage *StageConfig
RiserGeneration int64
SecretNames []string
ManualRollout bool
}
type DeploymentDoc ¶
type DeploymentDoc struct {
Status *DeploymentStatus `json:"status,omitempty"`
Traffic []TrafficConfigRule `json:"traffic"`
}
func (*DeploymentDoc) Scan ¶
func (a *DeploymentDoc) Scan(value interface{}) error
Needed for sql.Scanner interface
type DeploymentDocker ¶
type DeploymentDocker struct {
Tag string `json:"tag"`
}
type DeploymentRepository ¶
type DeploymentRepository interface {
Create(newDeployment *Deployment) error
FindByApp(appName string) ([]Deployment, error)
Get(name, stageName string) (*Deployment, error)
UpdateStatus(name, stageName string, status *DeploymentStatus) error
UpdateTraffic(name, stageName string, riserGeneration int64, traffic TrafficConfig) error
IncrementGeneration(name, stageName string) (int64, error)
RollbackGeneration(name, stageName string, failedGeneration int64) (int64, error)
}
type DeploymentRevisionStatus ¶ added in v0.0.6
type DeploymentRevisionStatus struct {
Name string `json:"name"`
AvailableReplicas int32 `json:"availableReplicas"`
DockerImage string `json:"dockerImage"`
RiserGeneration int64 `json:"riserGeneration"`
RolloutStatus string `json:"rolloutStatus"`
RolloutStatusReason string `json:"rolloutStatusReason"`
Problems []StatusProblem `json:"problems"`
}
type DeploymentStatus ¶
type DeploymentStatus struct {
ObservedRiserGeneration int64 `json:"observedRiserGeneration"`
LastUpdated time.Time `json:"lastUpdated"`
Revisions []DeploymentRevisionStatus `json:"revisions"`
LatestReadyRevisionName string `json:"latestReadyRevisionName"`
LatestCreatedRevisionName string `json:"latestCreatedRevisionName"`
Traffic []DeploymentTrafficStatus `json:"traffic"`
}
type DeploymentTrafficStatus ¶ added in v0.0.6
type FakeApiKeyRepository ¶
type FakeApiKeyRepository struct {
GetByUserIdFn func(int) ([]ApiKey, error)
CreateFn func(int, []byte) (int, error)
CreateCallCount int
}
func (*FakeApiKeyRepository) Create ¶
func (r *FakeApiKeyRepository) Create(userId int, keyHash []byte) (int, error)
func (*FakeApiKeyRepository) GetByUserId ¶
func (r *FakeApiKeyRepository) GetByUserId(userId int) ([]ApiKey, error)
type FakeAppRepository ¶
type FakeAppRepository struct {
GetFn func(string) (*App, error)
GetCallCount int
CreateFn func(app *App) error
ListAppsFn func() ([]App, error)
}
func (*FakeAppRepository) Create ¶
func (fake *FakeAppRepository) Create(app *App) error
func (*FakeAppRepository) ListApps ¶
func (fake *FakeAppRepository) ListApps() ([]App, error)
type FakeDeploymentRepository ¶
type FakeDeploymentRepository struct {
CreateFn func(newDeployment *Deployment) error
CreateCallCount int
GetFn func(name, stageName string) (*Deployment, error)
GetCallCount int
FindByAppFn func(string) ([]Deployment, error)
IncrementGenerationFn func(name, stageName string) (int64, error)
IncrementGenerationCallCount int
RollbackGenerationFn func(name, stageName string, failedGeneration int64) (int64, error)
UpdateStatusFn func(name, stageName string, status *DeploymentStatus) error
UpdateStatusCallCount int
UpdateTrafficFn func(name, stageName string, riserGeneration int64, traffic TrafficConfig) error
UpdateTrafficCallCount int
}
func (*FakeDeploymentRepository) Create ¶
func (f *FakeDeploymentRepository) Create(newDeployment *Deployment) error
func (*FakeDeploymentRepository) FindByApp ¶
func (fake *FakeDeploymentRepository) FindByApp(appName string) ([]Deployment, error)
func (*FakeDeploymentRepository) Get ¶
func (f *FakeDeploymentRepository) Get(name, stageName string) (*Deployment, error)
func (*FakeDeploymentRepository) IncrementGeneration ¶
func (fake *FakeDeploymentRepository) IncrementGeneration(deploymentName, stageName string) (int64, error)
func (*FakeDeploymentRepository) RollbackGeneration ¶
func (fake *FakeDeploymentRepository) RollbackGeneration(name, stageName string, failedGeneration int64) (int64, error)
func (*FakeDeploymentRepository) UpdateStatus ¶
func (fake *FakeDeploymentRepository) UpdateStatus(deploymentName, stageName string, status *DeploymentStatus) error
func (*FakeDeploymentRepository) UpdateTraffic ¶ added in v0.0.6
func (fake *FakeDeploymentRepository) UpdateTraffic(name, stageName string, riserGeneration int64, traffic TrafficConfig) error
type FakeSecretMetaRepository ¶
type FakeSecretMetaRepository struct {
SaveFn func(*SecretMeta) error
SaveCallCount int
FindByStageFn func(string, string) ([]SecretMeta, error)
}
func (*FakeSecretMetaRepository) FindByStage ¶
func (fake *FakeSecretMetaRepository) FindByStage(appName string, stageName string) ([]SecretMeta, error)
func (*FakeSecretMetaRepository) Save ¶
func (fake *FakeSecretMetaRepository) Save(secretMeta *SecretMeta) error
type FakeStageRepository ¶
type FakeStageRepository struct {
GetFn func(string) (*Stage, error)
GetCallCount int
ListFn func() ([]Stage, error)
ListCallCount int
SaveFn func(*Stage) error
SaveCallCount int
}
func (*FakeStageRepository) List ¶
func (fake *FakeStageRepository) List() ([]Stage, error)
func (*FakeStageRepository) Save ¶
func (fake *FakeStageRepository) Save(stage *Stage) error
type FakeUserRepository ¶
type FakeUserRepository struct {
GetByApiKeyFn func(keyHash []byte) (*User, error)
GetByUsernameFn func(username string) (*User, error)
CreateFn func(newUser *NewUser) (int, error)
CreateCallCount int
GetActiveCountFn func() (int, error)
}
func (*FakeUserRepository) Create ¶
func (r *FakeUserRepository) Create(newUser *NewUser) (int, error)
func (*FakeUserRepository) GetActiveCount ¶
func (r *FakeUserRepository) GetActiveCount() (int, error)
func (*FakeUserRepository) GetByApiKey ¶
func (r *FakeUserRepository) GetByApiKey(keyHash []byte) (*User, error)
func (*FakeUserRepository) GetByUsername ¶
func (r *FakeUserRepository) GetByUsername(username string) (*User, error)
type ResourceFile ¶
type RuntimeConfig ¶
type RuntimeConfig struct {
BootstrapApikey string `split_words:"true"`
BindAddress string `split_words:"true" default:":8000"`
DeveloperMode bool `split_words:"true"`
GitUrl string `split_words:"true" required:"true"`
GitDir string `split_words:"true" default:"/tmp/riser/git"`
GitUsername string `split_words:"true"`
GitPassword string `split_words:"true"`
PostgresUrl string `split_words:"true" default:"postgres://postgres.riser-system.svc.cluster.local/riserdb?sslmode=disable&connect_timeout=3"`
PostgresUsername string `split_words:"true" required:"true"`
PostgresPassword string `split_words:"true" required:"true"`
PostgresMigrateOnStartup bool `split_words:"true" default:"true"`
}
RuntimeConfig provides config for the srver.
type SecretMeta ¶
type SecretMeta struct {
AppName string
StageName string
SecretName string
Doc SecretMetaDoc
}
type SecretMetaDoc ¶
func (*SecretMetaDoc) Scan ¶
func (a *SecretMetaDoc) Scan(value interface{}) error
Needed for sql.Scanner interface
type SecretMetaRepository ¶
type SecretMetaRepository interface {
Save(secretMeta *SecretMeta) error
FindByStage(appName string, stageName string) ([]SecretMeta, error)
}
type StageConfig ¶
type StageDoc ¶
type StageDoc struct {
LastPing time.Time `json:"lastPing"`
Config StageConfig `json:"config"`
}
type StageRepository ¶
type StageStatus ¶
type StatusProblem ¶ added in v0.0.6
type TrafficConfig ¶ added in v0.0.6
type TrafficConfig []TrafficConfigRule
Needed for serialization to postgres since we do partial updates on traffic
type TrafficConfigRule ¶ added in v0.0.6
type UserRepository ¶
type ValidationError ¶
type ValidationError struct {
Message string
// ValidationError represents the validation error that ocurred. See the API errorHandler for how this is returned to the client.
ValidationError error
// contains filtered or unexported fields
}
ValidationError provides an error consumable by a client. This is safe to return to the API as the errorHandler is aware of this error
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.