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 DeploymentStatus
- type DeploymentStatusProblem
- 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
- 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 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 DeploymentContext ¶
type DeploymentContext struct { Deployment *DeploymentConfig Stage *StageConfig RiserGeneration int64 SecretNames []string }
type DeploymentDoc ¶
type DeploymentDoc struct {
Status *DeploymentStatus `json:"status,omitempty"`
}
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 IncrementGeneration(name, stageName string) (int64, error) RollbackGeneration(name, stageName string, failedGeneration int64) (int64, error) }
type DeploymentStatus ¶
type DeploymentStatus struct { ObservedRiserGeneration int64 `json:"observedRiserGeneration"` RolloutStatus string `json:"rolloutStatus"` RolloutStatusReason string `json:"rolloutStatusReason"` RolloutRevision int64 `json:"revision"` DockerImage string `json:"dockerImage"` Problems []DeploymentStatusProblem `json:"problems"` LastUpdated time.Time `json:"lastUpdated"` }
type DeploymentStatusProblem ¶
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 }
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
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 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 ¶
- apikey_repository.go
- apikey_types.go
- app_repository.go
- app_types.go
- deployment_repository.go
- deployment_types.go
- errors.go
- json_util.go
- namespace_types.go
- resourcefile.go
- runtime_types.go
- secretmeta_repository.go
- secretmeta_types.go
- stage_repository.go
- stage_types.go
- user_repository.go
- user_types.go
Click to show internal directories.
Click to hide internal directories.