Documentation ¶
Index ¶
- Constants
- Variables
- func NewBulkStarter(starters []Starter) *bulkStarter
- type ActualContainerMetrics
- type BulkStarter
- type CommandFactory
- type Containerizer
- type Gardener
- func (g *Gardener) BulkInfo(handles []string) (map[string]garden.ContainerInfoEntry, error)
- func (g *Gardener) BulkMetrics(handles []string) (map[string]garden.ContainerMetricsEntry, error)
- func (g *Gardener) Capacity() (garden.Capacity, error)
- func (g *Gardener) Containers(props garden.Properties) ([]garden.Container, error)
- func (g *Gardener) Create(containerSpec garden.ContainerSpec) (ctr garden.Container, err error)
- func (g *Gardener) Destroy(handle string) error
- func (g *Gardener) GraceTime(container garden.Container) time.Duration
- func (g *Gardener) Lookup(handle string) (garden.Container, error)
- func (g *Gardener) Ping() error
- func (g *Gardener) Start() error
- func (g *Gardener) Stop()
- type Networker
- type NoopRestorer
- type NoopVolumizer
- type PeaCleaner
- type PropertyManager
- type Restorer
- type RootfsSpec
- type Starter
- type SysInfoProvider
- type UidGenerator
- type UidGeneratorFunc
- type VolumeCreator
- type VolumeDestroyMetricsGC
- type VolumeProvider
- type Volumizer
Constants ¶
View Source
const BridgeIPKey = "garden.network.host-ip"
View Source
const ContainerIPKey = "garden.network.container-ip"
View Source
const ExternalIPKey = "garden.network.external-ip"
View Source
const GraceTimeKey = "garden.grace-time"
View Source
const MappedPortsKey = "garden.network.mapped-ports"
View Source
const RawRootFSScheme = "raw"
View Source
const VolumizerSession = "volumizer"
Variables ¶
View Source
var ErrGraphDisabled = errors.New("volume graph is disabled")
Functions ¶
func NewBulkStarter ¶
func NewBulkStarter(starters []Starter) *bulkStarter
Types ¶
type ActualContainerMetrics ¶
type ActualContainerMetrics struct { CPU garden.ContainerCPUStat Memory garden.ContainerMemoryStat }
type BulkStarter ¶
type BulkStarter interface {
StartAll() error
}
type CommandFactory ¶
type Containerizer ¶
type Containerizer interface { Create(log lager.Logger, desiredContainerSpec spec.DesiredContainerSpec) error Handles() ([]string, error) StreamIn(log lager.Logger, handle string, streamInSpec garden.StreamInSpec) error StreamOut(log lager.Logger, handle string, streamOutSpec garden.StreamOutSpec) (io.ReadCloser, error) Run(log lager.Logger, handle string, processSpec garden.ProcessSpec, io garden.ProcessIO) (garden.Process, error) Attach(log lager.Logger, handle string, processGUID string, io garden.ProcessIO) (garden.Process, error) Stop(log lager.Logger, handle string, kill bool) error Destroy(log lager.Logger, handle string) error RemoveBundle(log lager.Logger, handle string) error Info(log lager.Logger, handle string) (spec.ActualContainerSpec, error) Metrics(log lager.Logger, handle string) (ActualContainerMetrics, error) }
type Gardener ¶
type Gardener struct { // SysInfoProvider returns total memory and total disk SysInfoProvider SysInfoProvider // Containerizer runs and manages linux containers Containerizer Containerizer // UidGenerator generates unique ids for containers UidGenerator UidGenerator // BulkStarter runs any needed Starters that do start-up tasks (e.g. setting up cgroups) BulkStarter BulkStarter // Networker creates a network for containers Networker Networker // Volumizer creates volumes for containers Volumizer Volumizer Logger lager.Logger // PropertyManager creates map of container properties PropertyManager PropertyManager // MaxContainers limits the advertised container capacity MaxContainers uint64 Restorer Restorer PeaCleaner PeaCleaner AllowPrivilgedContainers bool }
Gardener orchestrates other components to implement the Garden API
func (*Gardener) BulkMetrics ¶
func (*Gardener) Containers ¶
type Networker ¶
type Networker interface { Network(log lager.Logger, spec garden.ContainerSpec, pid int) error Capacity() uint64 Destroy(log lager.Logger, handle string) error NetIn(log lager.Logger, handle string, hostPort, containerPort uint32) (uint32, uint32, error) BulkNetOut(log lager.Logger, handle string, rules []garden.NetOutRule) error NetOut(log lager.Logger, handle string, rule garden.NetOutRule) error Restore(log lager.Logger, handle string) error }
type NoopRestorer ¶
type NoopRestorer struct{}
type NoopVolumizer ¶
type NoopVolumizer struct{}
func (NoopVolumizer) Create ¶
func (NoopVolumizer) Create(lager.Logger, string, RootfsSpec) (specs.Spec, error)
func (NoopVolumizer) Metrics ¶
func (NoopVolumizer) Metrics(lager.Logger, string, bool) (garden.ContainerDiskStat, error)
type PeaCleaner ¶
type PropertyManager ¶
type PropertyManager interface { All(handle string) (props garden.Properties, err error) Set(handle string, name string, value string) Remove(handle string, name string) error Get(handle string, name string) (string, bool) MatchesAll(handle string, props garden.Properties) bool DestroyKeySpace(string) error }
type Restorer ¶
func NewRestorer ¶
type RootfsSpec ¶
type RootfsSpec struct { RootFS *url.URL Username string `json:"-"` Password string `json:"-"` Namespaced bool QuotaSize int64 QuotaScope garden.DiskLimitScope }
TODO GoRename RootfsSpec
type SysInfoProvider ¶
type UidGenerator ¶
type UidGenerator interface {
Generate() string
}
type UidGeneratorFunc ¶
type UidGeneratorFunc func() string
func (UidGeneratorFunc) Generate ¶
func (fn UidGeneratorFunc) Generate() string
type VolumeCreator ¶
type VolumeDestroyMetricsGC ¶
type VolumeProvider ¶
type VolumeProvider struct { VolumeCreator VolumeCreator VolumeDestroyMetricsGC ContainerRootUID int ContainerRootGID int // contains filtered or unexported fields }
func NewVolumeProvider ¶
func NewVolumeProvider(creator VolumeCreator, manager VolumeDestroyMetricsGC, prepareRootfsCmd CommandFactory, commandrunner commandrunner.CommandRunner, rootUID, rootGID int) *VolumeProvider
func (*VolumeProvider) Create ¶
func (v *VolumeProvider) Create(log lager.Logger, spec garden.ContainerSpec) (specs.Spec, error)
type Volumizer ¶
type Volumizer interface { Create(log lager.Logger, spec garden.ContainerSpec) (specs.Spec, error) VolumeDestroyMetricsGC }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.