Documentation
¶
Index ¶
- Variables
- type Agent
- type CapacityConfig
- type Config
- type Container
- type ContainerCreationRunner
- type ContainerCreationRunnerInJson
- type ContainerInfo
- type CreateContainerMessage
- type CreateContainerResponse
- type JobInfo
- type MappedPort
- type MessageBusConfig
- type ProxyServer
- type Registry
- type RouterRegistrar
- type Task
- type TaskBackend
- type TaskLimits
- type Tasks
- type WardenContainer
- type WardenTaskBackend
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ Host: "127.0.0.1", MessageBus: MessageBusConfig{ Host: "127.0.0.1", Port: 4222, }, Capacity: CapacityConfig{ MemoryInBytes: 1 * gigabyte, DiskInBytes: 1 * gigabyte, }, WardenSocketPath: "/tmp/warden.sock", WardenContainersPath: "/opt/warden/containers", AdvertiseInterval: 10 * time.Second, }
View Source
var TaskAlreadyRegistered = errors.New("task already registered")
View Source
var TaskNotRegistered = errors.New("task not registered")
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { ID *uuid.UUID Registry *Registry // contains filtered or unexported fields }
func NewAgent ¶
func NewAgent(taskBackend TaskBackend, routerClient gibson.RouterClient, port int) (*Agent, error)
func (*Agent) HandleStarts ¶
func (*Agent) HandleStops ¶
type CapacityConfig ¶
type Config ¶
type Config struct { Host string MessageBus MessageBusConfig Capacity CapacityConfig AdvertiseInterval time.Duration WardenSocketPath string WardenContainersPath string }
func LoadConfig ¶
type ContainerCreationRunner ¶
type ContainerCreationRunner interface {
Run(request *CreateContainerMessage, response *CreateContainerResponse, cmd string) error
}
type ContainerCreationRunnerInJson ¶
type ContainerCreationRunnerInJson struct{}
func (*ContainerCreationRunnerInJson) Run ¶
func (runner *ContainerCreationRunnerInJson) Run(request *CreateContainerMessage, response *CreateContainerResponse, executable string) error
type ContainerInfo ¶
type ContainerInfo struct {
MemoryLimitInBytes uint64
}
type CreateContainerMessage ¶
type CreateContainerResponse ¶
type MappedPort ¶
type MappedPort uint32
type MessageBusConfig ¶
type ProxyServer ¶
type ProxyServer struct {
// contains filtered or unexported fields
}
func NewProxyServer ¶
func NewProxyServer(registry *Registry) (*ProxyServer, error)
func (*ProxyServer) Start ¶
func (p *ProxyServer) Start(port int) error
func (*ProxyServer) Stop ¶
func (p *ProxyServer) Stop() error
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Unregister ¶
type RouterRegistrar ¶
type Task ¶
type Task struct { SecureToken string ProcessState *os.ProcessState // contains filtered or unexported fields }
func (*Task) OnComplete ¶
func (t *Task) OnComplete(callback func())
type TaskBackend ¶
type TaskLimits ¶
func (*TaskLimits) IsValid ¶
func (limits *TaskLimits) IsValid() bool
type WardenContainer ¶
type WardenContainer struct { Handle string // contains filtered or unexported fields }
func NewWardenContainer ¶
func NewWardenContainer(wardenSocketPath string, limits TaskLimits, cmdRunner ContainerCreationRunner) (*WardenContainer, error)
func (*WardenContainer) Destroy ¶
func (c *WardenContainer) Destroy() error
func (*WardenContainer) ID ¶
func (c *WardenContainer) ID() string
type WardenTaskBackend ¶
func (WardenTaskBackend) ProvideCommand ¶
func (p WardenTaskBackend) ProvideCommand(container Container) *exec.Cmd
func (WardenTaskBackend) ProvideContainer ¶
func (p WardenTaskBackend) ProvideContainer(limits TaskLimits) (Container, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.