Documentation
¶
Overview ¶
Package pool provides reference implements of environent pool and cgroup pool
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CgroupBuilder ¶
CgroupBuilder builds cgroup for runner
type CgroupPool ¶
type CgroupPool struct {
// contains filtered or unexported fields
}
CgroupPool implements cgroup pool
func NewCgroupPool ¶
func NewCgroupPool(builder CgroupBuilder) *CgroupPool
NewCgroupPool creates new cgroup pool
type EnvPool ¶
type EnvPool struct {
// contains filtered or unexported fields
}
EnvPool implements container environment pool
func NewEnvPool ¶
func NewEnvPool(builder EnvironmentBuilder) *EnvPool
NewEnvPool creats new EnvPool with a builder
func (*EnvPool) Destroy ¶
func (p *EnvPool) Destroy(env container.Environment)
Destroy destory an environment
func (*EnvPool) Get ¶
func (p *EnvPool) Get() (envexec.Environment, error)
Get gets environment from pool, if pool is empty, creates new environment
func (*EnvPool) Put ¶
func (p *EnvPool) Put(env envexec.Environment)
Put puts environment to the pool with reset the environment
type Environment ¶
type Environment struct { container.Environment // contains filtered or unexported fields }
Environment defines interface to access container resources
func (*Environment) OpenAtWorkDir ¶
OpenAtWorkDir opens file relative to work directory
func (*Environment) WorkDir ¶
func (c *Environment) WorkDir() *os.File
WorkDir returns opened work directory, should not close after
type EnvironmentBuilder ¶
type EnvironmentBuilder interface {
Build() (container.Environment, error)
}
EnvironmentBuilder defines the abstract builder for container environment
type FakeCgroupPool ¶
type FakeCgroupPool struct {
// contains filtered or unexported fields
}
FakeCgroupPool implements cgroup pool but not actually do pool
func NewFakeCgroupPool ¶
func NewFakeCgroupPool(builder CgroupBuilder) *FakeCgroupPool
NewFakeCgroupPool creates FakeCgroupPool