Documentation
¶
Index ¶
- Constants
- 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 ClusterBackup
- type DeployID
- type Deployment
- type DeploymentEvent
- type DomainMigration
- type DomainMigrationEvent
- type Event
- type EventType
- type ExpandedFormation
- type Formation
- type Job
- type JobEvents
- type JobState
- type JobWatcher
- type Key
- type ListEventsOptions
- type LogOpts
- type NewJob
- type NotFoundError
- type Port
- type ProcessType
- type Provider
- type Release
- type ReleaseDeletion
- type ReleaseDeletionEvent
- type Resource
- type ResourceReq
- type SSELogChunk
- type Scale
- type StreamEventsOptions
- type ValidationError
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 ¶
This section is empty.
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:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
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 host.ArtifactType `json:"type,omitempty"`
URI string `json:"uri,omitempty"`
Meta map[string]string `json:"meta,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
}
func (*Artifact) HostArtifact ¶
func (a *Artifact) HostArtifact() *host.Artifact
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"`
DeployTimeout int32 `json:"deploy_timeout,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 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"`
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" EventTypeScale EventType = "scale" 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" )
type ExpandedFormation ¶
type ExpandedFormation struct {
App *App `json:"app,omitempty"`
Release *Release `json:"release,omitempty"`
ImageArtifact *Artifact `json:"artifact,omitempty"`
FileArtifacts []*Artifact `json:"file_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"`
}
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 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"`
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" 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 ListEventsOptions ¶
type NewJob ¶
type NewJob struct {
ReleaseID string `json:"release,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"`
}
type NotFoundError ¶
type NotFoundError struct {
Resource string `json:"field"`
}
func (NotFoundError) Error ¶
func (n NotFoundError) Error() string
type ProcessType ¶
type ProcessType struct {
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
Ports []Port `json:"ports,omitempty"`
Data bool `json:"data,omitempty"`
Omni bool `json:"omni,omitempty"` // omnipresent - present on all hosts
HostNetwork bool `json:"host_network,omitempty"`
Service string `json:"service,omitempty"`
Resurrect bool `json:"resurrect,omitempty"`
Resources resource.Resources `json:"resources,omitempty"`
// Entrypoint and Cmd are DEPRECATED: use Args instead
DeprecatedCmd []string `json:"cmd,omitempty"`
DeprecatedEntrypoint []string `json:"entrypoint,omitempty"`
}
type Release ¶
type Release struct {
ID string `json:"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 is to support old clients which expect releases
// to have a single ArtifactID
LegacyArtifactID string `json:"artifact,omitempty"`
}
func (*Release) FileArtifactIDs ¶
func (*Release) ImageArtifactID ¶
func (*Release) IsDockerReceiveDeploy ¶
func (*Release) IsGitDeploy ¶
func (*Release) SetImageArtifactID ¶
type ReleaseDeletion ¶
type ReleaseDeletionEvent ¶
type ReleaseDeletionEvent struct {
ReleaseDeletion *ReleaseDeletion `json:"release_deletion"`
Error string `json:"error"`
}
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 StreamEventsOptions ¶
type ValidationError ¶
type ValidationError struct {
Field string `json:"field,omitempty"`
Message string `json:"message"`
}
func (ValidationError) Error ¶
func (v ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.