Documentation ¶
Index ¶
- Variables
- func EnvironmentVariablesToModel(envVars []EnvironmentVariable) []models.EnvironmentVariable
- type AllocationFailure
- type AllocationRequest
- type Client
- type ClientProvider
- type Container
- type ContainerCompleteEvent
- type ContainerMetrics
- type ContainerReservedEvent
- type ContainerRunResult
- type ContainerRunningEvent
- type DiskLimitScope
- type EnvironmentVariable
- type Error
- type Event
- type EventSource
- type EventType
- type ExecutorResources
- type InnerContainer
- type LifecycleEvent
- type LogConfig
- type Metrics
- type MetricsConfig
- type PortMapping
- type Resource
- type RunInfo
- type RunRequest
- type State
- type Tags
- type WorkPoolSettings
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrContainerGuidNotAvailable = registerError("ContainerGuidNotAvailable", "container guid not available", http.StatusBadRequest) ErrContainerNotCompleted = registerError("ContainerNotCompleted", "container must be stopped before it can be deleted", http.StatusBadRequest) ErrInsufficientResourcesAvailable = registerError("InsufficientResourcesAvailable", "insufficient resources available", http.StatusServiceUnavailable) ErrContainerNotFound = registerError("ContainerNotFound", "container not found", http.StatusNotFound) ErrStepsInvalid = registerError("StepsInvalid", "steps invalid", http.StatusBadRequest) ErrLimitsInvalid = registerError("LimitsInvalid", "container limits invalid", http.StatusBadRequest) ErrGuidNotSpecified = registerError("GuidNotSpecified", "container guid not specified", http.StatusBadRequest) ErrInvalidTransition = registerError("InvalidStateTransition", "container cannot transition to given state", http.StatusConflict) ErrFailureToCheckSpace = registerError("ErrFailureToCheckSpace", "failed to check available space", http.StatusInternalServerError) ErrInvalidSecurityGroup = registerError("ErrInvalidSecurityGroup", "security group has invalid values", http.StatusBadRequest) )
View Source
var ErrUnknownEventType = errors.New("unknown event type")
View Source
var Errors = map[string]Error{}
Functions ¶
func EnvironmentVariablesToModel ¶
func EnvironmentVariablesToModel(envVars []EnvironmentVariable) []models.EnvironmentVariable
Types ¶
type AllocationFailure ¶
type AllocationFailure struct { AllocationRequest ErrorMsg string }
func NewAllocationFailure ¶
func NewAllocationFailure(req *AllocationRequest, msg string) AllocationFailure
func (*AllocationFailure) Error ¶
func (fail *AllocationFailure) Error() string
type AllocationRequest ¶
func NewAllocationRequest ¶
func NewAllocationRequest(guid string, resource *Resource, tags Tags) AllocationRequest
func (*AllocationRequest) Validate ¶
func (a *AllocationRequest) Validate() error
type Client ¶
type Client interface { Ping() error AllocateContainers(requests []AllocationRequest) ([]AllocationFailure, error) GetContainer(guid string) (Container, error) RunContainer(*RunRequest) error StopContainer(guid string) error DeleteContainer(guid string) error ListContainers(Tags) ([]Container, error) GetAllMetrics(Tags) (map[string]Metrics, error) GetMetrics(guid string) (ContainerMetrics, error) RemainingResources() (ExecutorResources, error) RemainingResourcesFrom([]Container) (ExecutorResources, error) TotalResources() (ExecutorResources, error) GetFiles(guid string, path string) (io.ReadCloser, error) SubscribeToEvents() (EventSource, error) Cleanup() }
type ClientProvider ¶
type Container ¶
type Container struct { Guid string `json:"guid"` Resource RunInfo Tags Tags State State `json:"state"` AllocatedAt int64 `json:"allocated_at"` ExternalIP string `json:"external_ip"` RunResult ContainerRunResult `json:"run_result"` }
func NewReservedContainerFromAllocationRequest ¶
func NewReservedContainerFromAllocationRequest(req *AllocationRequest, allocatedAt int64) Container
type ContainerCompleteEvent ¶
type ContainerCompleteEvent struct {
RawContainer Container `json:"container"`
}
func NewContainerCompleteEvent ¶
func NewContainerCompleteEvent(container Container) ContainerCompleteEvent
func (ContainerCompleteEvent) Container ¶
func (e ContainerCompleteEvent) Container() Container
func (ContainerCompleteEvent) EventType ¶
func (ContainerCompleteEvent) EventType() EventType
type ContainerMetrics ¶
type ContainerReservedEvent ¶
type ContainerReservedEvent struct {
RawContainer Container `json:"container"`
}
func NewContainerReservedEvent ¶
func NewContainerReservedEvent(container Container) ContainerReservedEvent
func (ContainerReservedEvent) Container ¶
func (e ContainerReservedEvent) Container() Container
func (ContainerReservedEvent) EventType ¶
func (ContainerReservedEvent) EventType() EventType
type ContainerRunResult ¶
type ContainerRunningEvent ¶
type ContainerRunningEvent struct {
RawContainer Container `json:"container"`
}
func NewContainerRunningEvent ¶
func NewContainerRunningEvent(container Container) ContainerRunningEvent
func (ContainerRunningEvent) Container ¶
func (e ContainerRunningEvent) Container() Container
func (ContainerRunningEvent) EventType ¶
func (ContainerRunningEvent) EventType() EventType
type DiskLimitScope ¶
type DiskLimitScope uint8
const ( ExclusiveDiskLimit DiskLimitScope = iota TotalDiskLimit DiskLimitScope = iota )
type EnvironmentVariable ¶
func EnvironmentVariablesFromModel ¶
func EnvironmentVariablesFromModel(envVars []*models.EnvironmentVariable) []EnvironmentVariable
type EventSource ¶
type ExecutorResources ¶
type ExecutorResources struct { MemoryMB int `json:"memory_mb"` DiskMB int `json:"disk_mb"` Containers int `json:"containers"` }
func NewExecutorResources ¶
func NewExecutorResources(memoryMB, diskMB, containers int) ExecutorResources
func (*ExecutorResources) Subtract ¶
func (r *ExecutorResources) Subtract(res *Resource) bool
type InnerContainer ¶
type InnerContainer Container
type LifecycleEvent ¶
type LifecycleEvent interface { Container() Container // contains filtered or unexported methods }
type Metrics ¶
type Metrics struct { MetricsConfig ContainerMetrics }
type MetricsConfig ¶
type PortMapping ¶
type Resource ¶
type Resource struct { MemoryMB int `json:"memory_mb"` DiskMB int `json:"disk_mb"` RootFSPath string `json:"rootfs"` }
func NewResource ¶
type RunInfo ¶
type RunInfo struct { CPUWeight uint `json:"cpu_weight"` DiskScope DiskLimitScope `json:"disk_scope,omitempty"` Ports []PortMapping `json:"ports"` LogConfig LogConfig `json:"log_config"` MetricsConfig MetricsConfig `json:"metrics_config"` StartTimeout uint `json:"start_timeout"` Privileged bool `json:"privileged"` Setup *models.Action `json:"setup"` Action *models.Action `json:"run"` Monitor *models.Action `json:"monitor"` EgressRules []*models.SecurityGroupRule `json:"egress_rules,omitempty"` Env []EnvironmentVariable `json:"env,omitempty"` }
type RunRequest ¶
func NewRunRequest ¶
func NewRunRequest(guid string, runInfo *RunInfo, tags Tags) RunRequest
Directories ¶
Path | Synopsis |
---|---|
allocationstore/fakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
event/fakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
fakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
gardenstore/fakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
keyed_lock/fakelockmanager
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
log_streamer/fake_log_streamer
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
steps/fakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
uploader/fake_uploader
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter |
Click to show internal directories.
Click to hide internal directories.