Documentation ¶
Index ¶
- Constants
- Variables
- func JobDownEvents(count int) map[JobState]int
- func JobUpEvents(count int) map[JobState]int
- type App
- type AppDeletion
- type AppDeletionEvent
- type AppGarbageCollection
- type AppGarbageCollectionEvent
- type AppRelease
- type Artifact
- type ArtifactType
- type ClusterBackup
- type DeployID
- type Deployment
- type DeploymentEvent
- type DeprecatedScale
- type DomainMigration
- type DomainMigrationEvent
- type Event
- type EventOp
- type EventType
- type ExpandedDeployment
- type ExpandedFormation
- type Formation
- type ImageEntrypoint
- type ImageLayer
- type ImageLayerType
- type ImageManifest
- type ImageManifestType
- type ImagePlatform
- type ImagePullInfo
- type ImagePullType
- type ImageRootfs
- type Job
- type JobEvents
- type JobState
- type JobWatcher
- type LabelFilter
- type LabelFilterExpression
- type LabelFilterExpressionOp
- type ListEventsOptions
- type LogAggregatorSinkConfig
- type NewJob
- type NotFoundError
- type PartitionType
- type Port
- type ProcessType
- type Provider
- type Release
- type ReleaseDeletion
- type ReleaseDeletionEvent
- type ReleaseType
- type Resource
- type ResourceReq
- type SSELogChunk
- type ScaleOptions
- type ScaleRequest
- type ScaleRequestState
- type Sink
- type SinkKind
- type StreamEventsOptions
- type SyslogFormat
- type SyslogSinkConfig
- type ValidationError
- type Volume
- type VolumeReq
- type VolumeState
Constants ¶
View Source
const ( ClusterBackupStatusRunning string = "running" ClusterBackupStatusComplete string = "complete" ClusterBackupStatusError string = "error" )
View Source
const DefaultDeployTimeout = 120 // seconds
View Source
const RouteParentRefPrefix = "controller/apps/"
Variables ¶
View Source
var DefaultImagePlatform = &ImagePlatform{
Architecture: "amd64",
OS: "linux",
}
View Source
var DefaultScaleTimeout = 30 * time.Second
View Source
var ErrNotFound = errors.New("controller: resource not found")
View Source
var ErrScalingStopped = errors.New("controller: scaling was stopped")
Functions ¶
func JobDownEvents ¶
func JobUpEvents ¶
Types ¶
type App ¶
type App struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Meta map[string]string `json:"meta"` Strategy string `json:"strategy,omitempty"` ReleaseID string `json:"release,omitempty"` DeployTimeout int32 `json:"deploy_timeout,omitempty"` CreatedAt *time.Time `json:"create_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
func (*App) DeployBatchSize ¶
DeployBatchSize returns the batch size to use when deploying using the in-batches deployment strategy
func (*App) RedisAppliance ¶
func (*App) SetDeployBatchSize ¶
SetDeployBatchSize sets the batch size to use when deploying using the in-batches deployment strategy
type AppDeletion ¶
type AppDeletionEvent ¶
type AppDeletionEvent struct { AppDeletion *AppDeletion `json:"app_deletion"` Error string `json:"error"` }
type AppGarbageCollection ¶
type AppGarbageCollectionEvent ¶
type AppGarbageCollectionEvent struct { AppGarbageCollection *AppGarbageCollection `json:"app_garbage_collection"` Error string `json:"error"` }
type AppRelease ¶
type Artifact ¶
type Artifact struct { ID string `json:"id,omitempty"` Type ArtifactType `json:"type,omitempty"` URI string `json:"uri,omitempty"` Meta map[string]string `json:"meta,omitempty"` RawManifest json.RawMessage `json:"manifest,omitempty"` Hashes map[string]string `json:"hashes,omitempty"` Size int64 `json:"size,omitempty"` LayerURLTemplate string `json:"layer_url_template,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` // contains filtered or unexported fields }
func (*Artifact) LayerURL ¶
func (a *Artifact) LayerURL(layer *ImageLayer) string
func (*Artifact) Manifest ¶
func (a *Artifact) Manifest() *ImageManifest
type ArtifactType ¶
type ArtifactType string
const ( // ArtifactTypeOwo is the type of artifact which references a Owo // image manifest ArtifactTypeOwo ArtifactType = "owo" // DeprecatedArtifactTypeFile is a deprecated artifact type which was // used to reference slugs when they used to be tarballs stored in the // blobstore (they are now squashfs based Owo images) DeprecatedArtifactTypeFile ArtifactType = "file" // DeprecatedArtifactTypeDocker is a deprecated artifact type which // used to reference a pinkerton-compatible Docker URI used to pull // Docker images from a Docker registry (they are now converted to // squashfs based Owo images either at build time or at push time by // docker-receive) DeprecatedArtifactTypeDocker ArtifactType = "docker" )
type ClusterBackup ¶
type ClusterBackup struct { ID string `json:"id,omitempty"` Status string `json:"status"` SHA512 string `json:"sha512,omitempty"` Size int64 `json:"size,omitempty"` Error string `json:"error,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` CompletedAt *time.Time `json:"completed_at,omitempty"` }
type Deployment ¶
type Deployment struct { ID string `json:"id,omitempty"` AppID string `json:"app,omitempty"` OldReleaseID string `json:"old_release,omitempty"` NewReleaseID string `json:"new_release,omitempty"` Strategy string `json:"strategy,omitempty"` Status string `json:"status,omitempty"` Processes map[string]int `json:"processes,omitempty"` Tags map[string]map[string]string `json:"tags,omitempty"` DeployTimeout int32 `json:"deploy_timeout,omitempty"` DeployBatchSize *int `json:"deploy_batch_size,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` FinishedAt *time.Time `json:"finished_at,omitempty"` }
type DeploymentEvent ¶
type DeploymentEvent struct { AppID string `json:"app,omitempty"` DeploymentID string `json:"deployment,omitempty"` ReleaseID string `json:"release,omitempty"` Status string `json:"status,omitempty"` JobType string `json:"job_type,omitempty"` JobState JobState `json:"job_state,omitempty"` Error string `json:"error,omitempty"` }
func (*DeploymentEvent) Err ¶
func (e *DeploymentEvent) Err() error
type DeprecatedScale ¶
type DomainMigration ¶
type DomainMigration struct { ID string `json:"id"` OldTLSCert *tlscert.Cert `json:"old_tls_cert,omitempty"` TLSCert *tlscert.Cert `json:"tls_cert,omitempty"` OldDomain string `json:"old_domain"` Domain string `json:"domain"` CreatedAt *time.Time `json:"created_at,omitempty"` FinishedAt *time.Time `json:"finished_at,omitempty"` }
type DomainMigrationEvent ¶
type DomainMigrationEvent struct { DomainMigration *DomainMigration `json:"domain_migration"` Error string `json:"error,omitempty"` }
type Event ¶
type Event struct { ID int64 `json:"id,omitempty"` AppID string `json:"app,omitempty"` ObjectType EventType `json:"object_type,omitempty"` ObjectID string `json:"object_id,omitempty"` UniqueID string `json:"-"` Data json.RawMessage `json:"data,omitempty"` Op EventOp `json:"-"` CreatedAt *time.Time `json:"created_at,omitempty"` }
type EventType ¶
type EventType string
const ( EventTypeApp EventType = "app" EventTypeAppDeletion EventType = "app_deletion" EventTypeAppRelease EventType = "app_release" EventTypeDeployment EventType = "deployment" EventTypeJob EventType = "job" EventTypeScaleRequest EventType = "scale_request" EventTypeScaleRequestCancelation EventType = "scale_request_cancelation" EventTypeRelease EventType = "release" EventTypeReleaseDeletion EventType = "release_deletion" EventTypeArtifact EventType = "artifact" EventTypeProvider EventType = "provider" EventTypeResource EventType = "resource" EventTypeResourceDeletion EventType = "resource_deletion" EventTypeResourceAppDeletion EventType = "resource_app_deletion" EventTypeKey EventType = "key" EventTypeKeyDeletion EventType = "key_deletion" EventTypeRoute EventType = "route" EventTypeRouteDeletion EventType = "route_deletion" EventTypeDomainMigration EventType = "domain_migration" EventTypeClusterBackup EventType = "cluster_backup" EventTypeAppGarbageCollection EventType = "app_garbage_collection" EventTypeSink EventType = "sink" EventTypeSinkDeletion EventType = "sink_deletion" EventTypeVolume EventType = "volume" // EventTypeDeprecatedScale is a deprecated event which is emitted for // old clients waiting for formations to be scaled (new clients should // create and wait for scale requests) EventTypeDeprecatedScale EventType = "scale" )
type ExpandedDeployment ¶
type ExpandedDeployment struct { ID string `json:"id,omitempty"` AppID string `json:"app,omitempty"` OldRelease *Release `json:"old_release,omitempty"` NewRelease *Release `json:"new_release,omitempty"` Type ReleaseType `json:"type,omitempty"` Strategy string `json:"strategy,omitempty"` Status string `json:"status,omitempty"` Processes map[string]int `json:"processes,omitempty"` Tags map[string]map[string]string `json:"tags,omitempty"` DeployTimeout int32 `json:"deploy_timeout,omitempty"` DeployBatchSize *int `json:"deploy_batch_size,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` FinishedAt *time.Time `json:"finished_at,omitempty"` }
type ExpandedFormation ¶
type ExpandedFormation struct { App *App `json:"app,omitempty"` Release *Release `json:"release,omitempty"` Artifacts []*Artifact `json:"artifacts,omitempty"` Processes map[string]int `json:"processes,omitempty"` Tags map[string]map[string]string `json:"tags,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` Deleted bool `json:"deleted,omitempty"` PendingScaleRequest *ScaleRequest `json:"pending_scale_request,omitempty"` DeprecatedImageArtifact *Artifact `json:"artifact,omitempty"` }
func (*ExpandedFormation) Formation ¶
func (e *ExpandedFormation) Formation() *Formation
type Formation ¶
type Formation struct { AppID string `json:"app,omitempty"` ReleaseID string `json:"release,omitempty"` Processes map[string]int `json:"processes,omitempty"` Tags map[string]map[string]string `json:"tags,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
type ImageEntrypoint ¶
type ImageLayer ¶
type ImageLayerType ¶
type ImageLayerType string
const ImageLayerTypeSquashfs ImageLayerType = "application/vnd.owo.image.squashfs.v1"
type ImageManifest ¶
type ImageManifest struct { Type ImageManifestType `json:"_type"` Meta map[string]string `json:"meta,omitempty"` Entrypoints map[string]*ImageEntrypoint `json:"entrypoints,omitempty"` Rootfs []*ImageRootfs `json:"rootfs,omitempty"` // contains filtered or unexported fields }
func (*ImageManifest) DefaultEntrypoint ¶
func (m *ImageManifest) DefaultEntrypoint() *ImageEntrypoint
func (*ImageManifest) Hashes ¶
func (i *ImageManifest) Hashes() map[string]string
func (*ImageManifest) ID ¶
func (i *ImageManifest) ID() string
func (ImageManifest) RawManifest ¶
func (i ImageManifest) RawManifest() json.RawMessage
type ImageManifestType ¶
type ImageManifestType string
const ImageManifestTypeV1 ImageManifestType = "application/vnd.owo.image.manifest.v1+json"
type ImagePlatform ¶
type ImagePullInfo ¶
type ImagePullInfo struct { Name string `json:"name"` Type ImagePullType `json:"type"` Artifact *Artifact `json:"artifact"` Layer *ImageLayer `json:"layer"` }
type ImagePullType ¶
type ImagePullType string
const ( ImagePullTypeImage ImagePullType = "image" ImagePullTypeLayer ImagePullType = "layer" )
type ImageRootfs ¶
type ImageRootfs struct { Platform *ImagePlatform `json:"platform,omitempty"` Layers []*ImageLayer `json:"layers,omitempty"` }
type Job ¶
type Job struct { // ID is the job's full cluster ID (i.e. hostID-UUID) and can be empty // if the job is pending ID string `json:"id,omitempty"` // UUID is the uuid part of the job's full cluster ID and is the // primary key field in the database (so it is always set) UUID string `json:"uuid"` // HostID is the host ID part of the job's full cluster ID and can be // empty if the job is pending HostID string `json:"host_id,omitempty"` AppID string `json:"app,omitempty"` ReleaseID string `json:"release,omitempty"` Type string `json:"type,omitempty"` State JobState `json:"state,omitempty"` Args []string `json:"args,omitempty"` VolumeIDs []string `json:"volumes,omitempty"` Meta map[string]string `json:"meta,omitempty"` ExitStatus *int32 `json:"exit_status,omitempty"` HostError *string `json:"host_error,omitempty"` RunAt *time.Time `json:"run_at,omitempty"` Restarts *int32 `json:"restarts,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
type JobState ¶
type JobState string
const ( JobStatePending JobState = "pending" JobStateBlocked JobState = "blocked" JobStateStarting JobState = "starting" JobStateUp JobState = "up" JobStateStopping JobState = "stopping" JobStateDown JobState = "down" // JobStateCrashed and JobStateFailed are no longer valid job states, // but we still need to handle them in case they are set by old // schedulers still using the legacy code. JobStateCrashed JobState = "crashed" JobStateFailed JobState = "failed" )
type JobWatcher ¶
type LabelFilter ¶
type LabelFilter []*LabelFilterExpression
type LabelFilterExpression ¶
type LabelFilterExpression struct { Op LabelFilterExpressionOp `json:"op"` Key string `json:"key"` Values []string `json:"values"` }
type LabelFilterExpressionOp ¶
type LabelFilterExpressionOp int
var ( LabelFilterExpressionOpIn LabelFilterExpressionOp = 0 LabelFilterExpressionOpNotIn LabelFilterExpressionOp = 1 LabelFilterExpressionOpExists LabelFilterExpressionOp = 2 LabelFilterExpressionOpNotExists LabelFilterExpressionOp = 3 )
type ListEventsOptions ¶
type LogAggregatorSinkConfig ¶
type LogAggregatorSinkConfig struct {
Addr string `json:"addr"`
}
type NewJob ¶
type NewJob struct { ReleaseID string `json:"release,omitempty"` ArtifactIDs []string `json:"artifacts,omitempty"` ReleaseEnv bool `json:"release_env,omitempty"` Args []string `json:"args,omitempty"` Env map[string]string `json:"env,omitempty"` Meta map[string]string `json:"meta,omitempty"` TTY bool `json:"tty,omitempty"` Columns int `json:"tty_columns,omitempty"` Lines int `json:"tty_lines,omitempty"` DisableLog bool `json:"disable_log,omitempty"` Resources resource.Resources `json:"resources,omitempty"` Data bool `json:"data,omitempty"` Partition PartitionType `json:"partition,omitempty"` Profiles []host.JobProfile `json:"profiles,omitempty"` // MountsFrom is a process type to copy mounts from MountsFrom string `json:"mounts_from,omitempty"` // Entrypoint and Cmd are DEPRECATED: use Args instead DeprecatedCmd []string `json:"cmd,omitempty"` DeprecatedEntrypoint []string `json:"entrypoint,omitempty"` // Artifact is DEPRECATED: use Artifacts instead DeprecatedArtifact string `json:"artifact,omitempty"` }
type NotFoundError ¶
type NotFoundError struct {
Resource string `json:"field"`
}
func (NotFoundError) Error ¶
func (n NotFoundError) Error() string
type PartitionType ¶
type PartitionType string
const ( PartitionTypeBackground PartitionType = "background" PartitionTypeSystem PartitionType = "system" PartitionTypeUser PartitionType = "user" )
type ProcessType ¶
type ProcessType struct { Args []string `json:"args,omitempty"` Env map[string]string `json:"env,omitempty"` Ports []Port `json:"ports,omitempty"` Volumes []VolumeReq `json:"volumes,omitempty"` Omni bool `json:"omni,omitempty"` // omnipresent - present on all hosts HostNetwork bool `json:"host_network,omitempty"` HostPIDNamespace bool `json:"host_pid_namespace,omitempty"` Service string `json:"service,omitempty"` Resurrect bool `json:"resurrect,omitempty"` Resources resource.Resources `json:"resources,omitempty"` Mounts []host.Mount `json:"mounts,omitempty"` Profiles []host.JobProfile `json:"profiles,omitempty"` LinuxCapabilities []string `json:"linux_capabilities,omitempty"` AllowedDevices []*host.Device `json:"allowed_devices,omitempty"` WriteableCgroups bool `json:"writeable_cgroups,omitempty"` // Entrypoint and Cmd are DEPRECATED: use Args instead DeprecatedCmd []string `json:"cmd,omitempty"` DeprecatedEntrypoint []string `json:"entrypoint,omitempty"` // Data is DEPRECATED: populate Volumes instead DeprecatedData bool `json:"data,omitempty"` }
type Release ¶
type Release struct { ID string `json:"id,omitempty"` AppID string `json:"app_id,omitempty"` ArtifactIDs []string `json:"artifacts,omitempty"` Env map[string]string `json:"env,omitempty"` Meta map[string]string `json:"meta,omitempty"` Processes map[string]ProcessType `json:"processes,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` LegacyArtifactID string `json:"artifact,omitempty"` }
func (*Release) IsDockerReceiveDeploy ¶
func (*Release) IsGitDeploy ¶
type ReleaseDeletion ¶
type ReleaseDeletionEvent ¶
type ReleaseDeletionEvent struct { ReleaseDeletion *ReleaseDeletion `json:"release_deletion"` Error string `json:"error"` }
type ReleaseType ¶
type ReleaseType string
var ( ReleaseTypeAny ReleaseType = "any" ReleaseTypeCode ReleaseType = "code" ReleaseTypeConfig ReleaseType = "config" )
type ResourceReq ¶
type ResourceReq struct { ProviderID string `json:"-"` Apps []string `json:"apps,omitempty"` Config *json.RawMessage `json:"config"` }
type SSELogChunk ¶
type SSELogChunk struct { Event string `json:"event,omitempty"` Data json.RawMessage `json:"data,omitempty"` }
SSELogChunk is used as a data wrapper for the `GET /apps/:apps_id/log` SSE stream
type ScaleOptions ¶
type ScaleRequest ¶
type ScaleRequest struct { ID string `json:"id"` AppID string `json:"app"` ReleaseID string `json:"release"` State ScaleRequestState `json:"state"` OldProcesses map[string]int `json:"old_processes,omitempty"` NewProcesses *map[string]int `json:"new_processes,omitempty"` OldTags map[string]map[string]string `json:"old_tags,omitempty"` NewTags *map[string]map[string]string `json:"new_tags,omitempty"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` }
type ScaleRequestState ¶
type ScaleRequestState string
const ( ScaleRequestStatePending ScaleRequestState = "pending" ScaleRequestStateCancelled ScaleRequestState = "cancelled" ScaleRequestStateComplete ScaleRequestState = "complete" )
type StreamEventsOptions ¶
type SyslogFormat ¶
type SyslogFormat string
const ( SyslogFormatRFC6587 SyslogFormat = "rfc6587" SyslogFormatNewline SyslogFormat = "newline" SyslogFormatPrefixedNewline SyslogFormat = "prefixed_newline" )
type SyslogSinkConfig ¶
type ValidationError ¶
type ValidationError struct { Field string `json:"field,omitempty"` Message string `json:"message"` }
func (ValidationError) Error ¶
func (v ValidationError) Error() string
type Volume ¶
type Volume struct { VolumeReq ID string `json:"id"` HostID string `json:"host_id"` Type volume.VolumeType `json:"type"` State VolumeState `json:"state"` AppID string `json:"app,omitempty"` ReleaseID string `json:"release,omitempty"` JobID *string `json:"job,omitempty"` JobType string `json:"job_type,omitempty"` Meta map[string]string `json:"meta,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` DecommissionedAt *time.Time `json:"decommissioned_at,omitempty"` }
type VolumeState ¶
type VolumeState string
const ( VolumeStatePending VolumeState = "pending" VolumeStateCreated VolumeState = "created" VolumeStateDestroyed VolumeState = "destroyed" )
Click to show internal directories.
Click to hide internal directories.