Versions in this module Expand all Collapse all v0 v0.1441.2 Jan 13, 2016 Changes in this version + var ErrContainerGuidNotAvailable = registerError("ContainerGuidNotAvailable", "container guid not available", ...) + var ErrContainerNotCompleted = registerError("ContainerNotCompleted", "container must be stopped before it can be deleted", ...) + var ErrContainerNotFound = registerError("ContainerNotFound", "container not found", http.StatusNotFound) + var ErrFailureToCheckSpace = registerError("ErrFailureToCheckSpace", "failed to check available space", ...) + var ErrGuidNotSpecified = registerError("GuidNotSpecified", "container guid not specified", http.StatusBadRequest) + var ErrInsufficientResourcesAvailable = registerError("InsufficientResourcesAvailable", "insufficient resources available", ...) + var ErrInvalidSecurityGroup = registerError("ErrInvalidSecurityGroup", "security group has invalid values", ...) + var ErrInvalidTransition = registerError("InvalidStateTransition", "container cannot transition to given state", ...) + var ErrLimitsInvalid = registerError("LimitsInvalid", "container limits invalid", http.StatusBadRequest) + var ErrStepsInvalid = registerError("StepsInvalid", "steps invalid", http.StatusBadRequest) + var ErrUnknownEventType = errors.New("unknown event type") + var Errors = map[string]Error + func EnvironmentVariablesToModel(envVars []EnvironmentVariable) []models.EnvironmentVariable + type AllocationFailure struct + ErrorMsg string + func NewAllocationFailure(req *AllocationRequest, msg string) AllocationFailure + func (fail *AllocationFailure) Error() string + type AllocationRequest struct + Guid string + func NewAllocationRequest(guid string, resource *Resource, tags Tags) AllocationRequest + func (a *AllocationRequest) Validate() error + type Client interface + AllocateContainers func(requests []AllocationRequest) ([]AllocationFailure, error) + Cleanup func() + DeleteContainer func(guid string) error + GetAllMetrics func(Tags) (map[string]Metrics, error) + GetContainer func(guid string) (Container, error) + GetFiles func(guid string, path string) (io.ReadCloser, error) + GetMetrics func(guid string) (ContainerMetrics, error) + ListContainers func(Tags) ([]Container, error) + Ping func() error + RemainingResources func() (ExecutorResources, error) + RemainingResourcesFrom func([]Container) (ExecutorResources, error) + RunContainer func(*RunRequest) error + StopContainer func(guid string) error + SubscribeToEvents func() (EventSource, error) + TotalResources func() (ExecutorResources, error) + type ClientProvider interface + WithLogger func(logger lager.Logger) Client + type Container struct + AllocatedAt int64 + ExternalIP string + Guid string + RunResult ContainerRunResult + State State + Tags Tags + func NewContainerFromResource(guid string, resource *Resource, tags Tags) Container + func NewReservedContainerFromAllocationRequest(req *AllocationRequest, allocatedAt int64) Container + func (c *Container) HasTags(tags Tags) bool + func (newContainer Container) Copy() Container + type ContainerCompleteEvent struct + RawContainer Container + func NewContainerCompleteEvent(container Container) ContainerCompleteEvent + func (ContainerCompleteEvent) EventType() EventType + func (e ContainerCompleteEvent) Container() Container + type ContainerMetrics struct + DiskUsageInBytes uint64 + MemoryUsageInBytes uint64 + TimeSpentInCPU time.Duration + type ContainerReservedEvent struct + RawContainer Container + func NewContainerReservedEvent(container Container) ContainerReservedEvent + func (ContainerReservedEvent) EventType() EventType + func (e ContainerReservedEvent) Container() Container + type ContainerRunResult struct + Failed bool + FailureReason string + Stopped bool + type ContainerRunningEvent struct + RawContainer Container + func NewContainerRunningEvent(container Container) ContainerRunningEvent + func (ContainerRunningEvent) EventType() EventType + func (e ContainerRunningEvent) Container() Container + type DiskLimitScope uint8 + const ExclusiveDiskLimit + const TotalDiskLimit + type EnvironmentVariable struct + Name string + Value string + func EnvironmentVariablesFromModel(envVars []*models.EnvironmentVariable) []EnvironmentVariable + type Error interface + HttpCode func() int + Name func() string + type Event interface + EventType func() EventType + type EventSource interface + Close func() error + Next func() (Event, error) + type EventType string + const EventTypeContainerComplete + const EventTypeContainerReserved + const EventTypeContainerRunning + const EventTypeInvalid + type ExecutorResources struct + Containers int + DiskMB int + MemoryMB int + func NewExecutorResources(memoryMB, diskMB, containers int) ExecutorResources + func (r *ExecutorResources) Subtract(res *Resource) bool + type InnerContainer Container + type LifecycleEvent interface + Container func() Container + type LogConfig struct + Guid string + Index int + SourceName string + type Metrics struct + type MetricsConfig struct + Guid string + Index int + type PortMapping struct + ContainerPort uint16 + HostPort uint16 + type Resource struct + DiskMB int + MemoryMB int + RootFSPath string + func NewResource(memoryMB, diskMB int, rootFSPath string) Resource + type RunInfo struct + Action *models.Action + CPUWeight uint + DiskScope DiskLimitScope + EgressRules []*models.SecurityGroupRule + Env []EnvironmentVariable + LogConfig LogConfig + MetricsConfig MetricsConfig + Monitor *models.Action + Ports []PortMapping + Privileged bool + Setup *models.Action + StartTimeout uint + type RunRequest struct + Guid string + func NewRunRequest(guid string, runInfo *RunInfo, tags Tags) RunRequest + type State string + const StateCompleted + const StateCreated + const StateInitializing + const StateInvalid + const StateReserved + const StateRunning + type Tags map[string]string + func (t Tags) Add(other Tags) + func (t Tags) Copy() Tags + type WorkPoolSettings struct + CreateWorkPoolSize int + DeleteWorkPoolSize int + MetricsWorkPoolSize int + ReadWorkPoolSize int