Documentation ¶
Index ¶
- type App
- type BytesValue
- type Component
- type ComponentAddresses
- type ContainerBlueprint
- type CoresValue
- type CustomDeployScript
- type Entrypoint
- type EnvVar
- type ID
- type ImageRepo
- type Instance
- type InstanceStatus
- type Meta
- type Mount
- type PersistableComponent
- type Port
- type PortAddress
- type Release
- type ResourceAllocation
- type Tags
- type Task
- type TaskType
- type Timestamp
- type VolumeBlueprint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BytesValue ¶
type BytesValue struct {
// contains filtered or unexported fields
}
func BytesFromMiB ¶
func BytesFromMiB(mib uint) *BytesValue
func (*BytesValue) ToKubeMebibytes ¶
func (v *BytesValue) ToKubeMebibytes() string
type Component ¶
type Component struct { *PersistableComponent Addresses *ComponentAddresses `json:"addresses"` }
type ComponentAddresses ¶
type ComponentAddresses struct { External []*PortAddress `json:"external"` Internal []*PortAddress `json:"internal"` }
type ContainerBlueprint ¶
type ContainerBlueprint struct { Image string `json:"image"` Ports []*Port `json:"ports"` Env []*EnvVar `json:"env"` CPU *ResourceAllocation `json:"cpu"` RAM *ResourceAllocation `json:"ram"` Mounts []*Mount `json:"mounts"` }
Container ==============================================================================
type CoresValue ¶
type CoresValue struct {
// contains filtered or unexported fields
}
func CoresFromMillicores ¶
func CoresFromMillicores(millicores uint) *CoresValue
func (*CoresValue) ToKubeMillicores ¶
func (v *CoresValue) ToKubeMillicores() string
type CustomDeployScript ¶
TODO implement...
type Entrypoint ¶
type Entrypoint struct { Domain ID `json:"domain"` // e.g. blog.qbox.io Address string `json:"address"` // the ELB address *Meta }
Entrypoint ==============================================================================
type EnvVar ¶
type EnvVar struct { Name string `json:"name"` Value string `json:"value"` // this may be templated, "something_{{ instance_id }}" }
EnvVar ==============================================================================
type ID ¶
type ID *string
ID is defined as a string pointer in order to check for nil in the context of relations. NOTE this may not be best practice.
type ImageRepo ¶
ImageRepo ==============================================================================
type Instance ¶
type Instance struct { ID ID `json:"id"` // actually just the number (starting w/ 1) of the instance order in the release // BaseName is the name of the instance without the Release ID appended. It is // used for naming volumes, which move between releases. BaseName string `json:"base_name"` Name string `json:"name"` Status InstanceStatus `json:"status"` }
NOTE Instances are not stored in etcd, so the json tags here apply to HTTP
type InstanceStatus ¶
type InstanceStatus string
Instance ==============================================================================
const ( InstanceStatusStopped InstanceStatus = "STOPPED" InstanceStatusStarted InstanceStatus = "STARTED" )
type Meta ¶
type Meta struct { Created *Timestamp `json:"created"` Updated *Timestamp `json:"updated"` Tags Tags `json:"tags"` }
Meta is a set of fields on all Resources for holding metadata.
type Mount ¶
type Mount struct { Volume ID `json:"volume"` // TODO should be VolumeName Path string `json:"path"` }
Mount ==============================================================================
type PersistableComponent ¶
type PersistableComponent struct { Name ID `json:"name"` // TODO kinda weird, // you choose a container that has the deploy file, and then reference it as a command CustomDeployScript *CustomDeployScript `json:"custom_deploy_script"` // TODO these all seem to be a departure in terms of relations... I feel like // there is a more elegant solution to house the info, and delete it atomically CurrentReleaseTimestamp ID `json:"current_release_id"` TargetReleaseTimestamp ID `json:"target_release_id"` // We should just store the DeployTaskID but actually should render the task // when showing it in HTTP. DeployTaskID ID `json:"deploy_task_id"` *Meta }
see note in core/resource.go about PersistableObject()
type Port ¶
type Port struct { Protocol string `json:"protocol"` Number int `json:"number"` // should be uint Public bool `json:"public"` // EntrypointDomain specifies which Entrypoint this Port is added to. Does not // apply when Public is false. EntrypointDomain ID `json:"entrypoint_domain,omitempty"` // PreserveNumber instructs the Entrypoint to set the actual Port number // specified as the external load balancer port. Does not apply when // EntrypointDomain is nil. // // NOTE we may want to replace this with something like ExternalNumber so that // it is more flexible / obvious. PreserveNumber bool `json:"preserve_number"` }
Port ==============================================================================
type PortAddress ¶
type Release ¶
type Release struct { // NOTE Timestamp here does not use the Timestamp type. Timestamp ID `json:"timestamp"` InstanceCount int `json:"instance_count"` // These attributes, when changed from last Release, indicate a restart is // needed (or just new instances through other means). Volumes []*VolumeBlueprint `json:"volumes"` Containers []*ContainerBlueprint `json:"containers"` TerminationGracePeriod int `json:"termination_grace_period"` // Retired defines whether or not a Release still has active assets, like pods // or services. When retired is true, we skip attempting to delete assets. Retired bool `json:"retired"` *Meta }
Release ============================================================================== NOTE the word Blueprint is used for Volumes and Containers, since they are both "definitions" that create "instances" of the real thing
type ResourceAllocation ¶
ResourceAllocation ==============================================================================
type TaskType ¶
type TaskType int
Task ==============================================================================
type Timestamp ¶
func NewTimestamp ¶
func NewTimestamp() *Timestamp
func (*Timestamp) MarshalJSON ¶
func (*Timestamp) UnmarshalJSON ¶
type VolumeBlueprint ¶
type VolumeBlueprint struct { Name ID `json:"name"` Type string `json:"type"` Size int `json:"size"` }
Volume ==============================================================================