types

package
v0.0.0-...-b359386 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 JobDownEvents(count int) map[JobState]int

func JobUpEvents

func JobUpEvents(count int) map[JobState]int

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) Critical

func (a *App) Critical() bool

Critical apps cannot be completely scaled down by the scheduler

func (*App) DeployBatchSize

func (a *App) DeployBatchSize() *int

DeployBatchSize returns the batch size to use when deploying using the in-batches deployment strategy

func (*App) RedisAppliance

func (a *App) RedisAppliance() bool

func (*App) SetDeployBatchSize

func (a *App) SetDeployBatchSize(size int)

SetDeployBatchSize sets the batch size to use when deploying using the in-batches deployment strategy

func (*App) System

func (a *App) System() bool

type AppDeletion

type AppDeletion struct {
	AppID            string          `json:"app"`
	DeletedRoutes    []*router.Route `json:"deleted_routes"`
	DeletedResources []*Resource     `json:"deleted_resources"`
	DeletedReleases  []*Release      `json:"deleted_releases"`
}

type AppDeletionEvent

type AppDeletionEvent struct {
	AppDeletion *AppDeletion `json:"app_deletion"`
	Error       string       `json:"error"`
}

type AppGarbageCollection

type AppGarbageCollection struct {
	AppID           string   `json:"app_id"`
	DeletedReleases []string `json:"deleted_releases"`
}

type AppGarbageCollectionEvent

type AppGarbageCollectionEvent struct {
	AppGarbageCollection *AppGarbageCollection `json:"app_garbage_collection"`
	Error                string                `json:"error"`
}

type AppRelease

type AppRelease struct {
	PrevRelease *Release `json:"prev_release,omitempty"`
	Release     *Release `json:"release"`
}

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) Blobstore

func (a *Artifact) Blobstore() bool

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 DeployID

type DeployID struct {
	ID string
}

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 DeprecatedScale struct {
	PrevProcesses map[string]int `json:"prev_processes,omitempty"`
	Processes     map[string]int `json:"processes"`
	ReleaseID     string         `json:"release"`
}

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 EventOp

type EventOp string
const (
	EventOpCreate EventOp = "op_create"
	EventOpUpdate EventOp = "op_update"
)

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 ImageEntrypoint struct {
	Env               map[string]string `json:"env,omitempty"`
	WorkingDir        string            `json:"cwd,omitempty"`
	Args              []string          `json:"args,omitempty"`
	LinuxCapabilities []string          `json:"linux_capabilities,omitempty"`
	Uid               *uint32           `json:"uid,omitempty"`
	Gid               *uint32           `json:"gid,omitempty"`
}

type ImageLayer

type ImageLayer struct {
	ID     string            `json:"id,omitempty"`
	Type   ImageLayerType    `json:"type,omitempty"`
	Length int64             `json:"length,omitempty"`
	Hashes map[string]string `json:"hashes,omitempty"`
	Meta   map[string]string `json:"meta,omitempty"`
}

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 ImagePlatform struct {
	Architecture string `json:"architecture,omitempty"`
	OS           string `json:"os,omitempty"`
}

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"`
}

func (*Job) IsDown

func (e *Job) IsDown() bool

type JobEvents

type JobEvents map[string]map[JobState]int

func (JobEvents) Count

func (j JobEvents) Count() int

func (JobEvents) Equals

func (j JobEvents) Equals(other JobEvents) bool

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 JobWatcher interface {
	WaitFor(expected JobEvents, timeout time.Duration, callback func(*Job) error) error
	Close() error
}

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 ListEventsOptions struct {
	AppID       string
	ObjectTypes []EventType
	ObjectID    string
	BeforeID    *int64
	SinceID     *int64
	Count       int
}

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 Port

type Port struct {
	Port    int           `json:"port"`
	Proto   string        `json:"proto"`
	Service *host.Service `json:"service,omitempty"`
}

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 Provider

type Provider struct {
	ID        string     `json:"id,omitempty"`
	URL       string     `json:"url,omitempty"`
	Name      string     `json:"name,omitempty"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,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 (r *Release) IsDockerReceiveDeploy() bool

func (*Release) IsGitDeploy

func (r *Release) IsGitDeploy() bool

type ReleaseDeletion

type ReleaseDeletion struct {
	AppID         string   `json:"app"`
	ReleaseID     string   `json:"release"`
	RemainingApps []string `json:"remaining_apps"`
	DeletedFiles  []string `json:"deleted_files"`
}

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 Resource

type Resource struct {
	ID         string            `json:"id,omitempty"`
	ProviderID string            `json:"provider,omitempty"`
	ExternalID string            `json:"external_id,omitempty"`
	Env        map[string]string `json:"env,omitempty"`
	Apps       []string          `json:"apps,omitempty"`
	CreatedAt  *time.Time        `json:"created_at,omitempty"`
}

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 ScaleOptions struct {
	Processes            map[string]int
	Tags                 map[string]map[string]string
	Timeout              *time.Duration
	Stop                 chan struct{}
	NoWait               bool
	ScaleRequestCallback func(*ScaleRequest)
	JobEventCallback     func(*Job) error
}

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 Sink

type Sink struct {
	ID          string           `json:"id"`
	Kind        SinkKind         `json:"kind"`
	HostManaged bool             `json:"host_managed,omitempty"`
	Config      *json.RawMessage `json:"config,omitempty"`
	CreatedAt   *time.Time       `json:"created_at,omitempty"`
	UpdatedAt   *time.Time       `json:"updated_at,omitempty"`
}

type SinkKind

type SinkKind string
const (
	SinkKindSyslog        SinkKind = "syslog"
	SinkKindLogaggregator SinkKind = "logaggregator"
)

type StreamEventsOptions

type StreamEventsOptions struct {
	AppID       string
	ObjectTypes []EventType
	ObjectID    string
	Past        bool
	Count       int
}

type SyslogFormat

type SyslogFormat string
const (
	SyslogFormatRFC6587         SyslogFormat = "rfc6587"
	SyslogFormatNewline         SyslogFormat = "newline"
	SyslogFormatPrefixedNewline SyslogFormat = "prefixed_newline"
)

type SyslogSinkConfig

type SyslogSinkConfig struct {
	URL            string       `json:"url"`
	Prefix         string       `json:"template,omitempty"`
	UseIDs         bool         `json:"use_ids,omitempty"`
	Insecure       bool         `json:"insecure,omitempty"`
	StructuredData bool         `json:"structured_data,omitempty"`
	Format         SyslogFormat `json:"format,omitempty"`
}

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 VolumeReq

type VolumeReq struct {
	Path         string `json:"path,omitempty"`
	DeleteOnStop bool   `json:"delete_on_stop,omitempty"`
}

type VolumeState

type VolumeState string
const (
	VolumeStatePending   VolumeState = "pending"
	VolumeStateCreated   VolumeState = "created"
	VolumeStateDestroyed VolumeState = "destroyed"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL