Documentation ¶
Index ¶
- func Create(ctx context.Context, id string, s *specs.Spec) (_ cow.Container, err error)
- type JobContainer
- func (c *JobContainer) Close() error
- func (c *JobContainer) CreateProcess(ctx context.Context, config interface{}) (_ cow.Process, err error)
- func (c *JobContainer) ID() string
- func (c *JobContainer) IsOCI() bool
- func (c *JobContainer) Modify(ctx context.Context, config interface{}) (err error)
- func (c *JobContainer) OS() string
- func (c *JobContainer) Properties(ctx context.Context, types ...schema1.PropertyType) (*schema1.ContainerProperties, error)
- func (c *JobContainer) PropertiesV2(ctx context.Context, types ...hcsschema.PropertyType) (*hcsschema.Properties, error)
- func (c *JobContainer) Release(ctx context.Context) error
- func (c *JobContainer) Shutdown(ctx context.Context) error
- func (c *JobContainer) Start(ctx context.Context) error
- func (c *JobContainer) Terminate(ctx context.Context) error
- func (c *JobContainer) Wait() error
- func (c *JobContainer) WaitChannel() <-chan struct{}
- func (c *JobContainer) WaitError() error
- type JobProcess
- func (p *JobProcess) Close() error
- func (p *JobProcess) CloseStderr(ctx context.Context) error
- func (p *JobProcess) CloseStdin(ctx context.Context) error
- func (p *JobProcess) CloseStdout(ctx context.Context) error
- func (p *JobProcess) ExitCode() (int, error)
- func (p *JobProcess) Kill(ctx context.Context) (bool, error)
- func (p *JobProcess) Pid() int
- func (p *JobProcess) ResizeConsole(ctx context.Context, width, height uint16) error
- func (p *JobProcess) Signal(ctx context.Context, options interface{}) (bool, error)
- func (p *JobProcess) Start() error
- func (p *JobProcess) Stdio() (io.Writer, io.Reader, io.Reader)
- func (p *JobProcess) Wait() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JobContainer ¶
type JobContainer struct {
// contains filtered or unexported fields
}
JobContainer represents a lightweight container composed from a job object.
func (*JobContainer) CreateProcess ¶
func (c *JobContainer) CreateProcess(ctx context.Context, config interface{}) (_ cow.Process, err error)
CreateProcess creates a process on the host, starts it, adds it to the containers job object and then waits for exit.
func (*JobContainer) ID ¶
func (c *JobContainer) ID() string
ID returns the ID of the container. This is the name used to create the job object.
func (*JobContainer) IsOCI ¶
func (c *JobContainer) IsOCI() bool
IsOCI - Just to satisfy the cow.ProcessHost interface. Follow the WCOW behavior
func (*JobContainer) Modify ¶
func (c *JobContainer) Modify(ctx context.Context, config interface{}) (err error)
func (*JobContainer) OS ¶
func (c *JobContainer) OS() string
OS returns the operating system name as a string. This should always be windows.
func (*JobContainer) Properties ¶
func (c *JobContainer) Properties(ctx context.Context, types ...schema1.PropertyType) (*schema1.ContainerProperties, error)
Properties returns properties relating to the job container. This is an HCS construct but to adhere to the interface for containers on Windows it is partially implemented. The only supported property is schema1.PropertyTypeProcessList.
func (*JobContainer) PropertiesV2 ¶
func (c *JobContainer) PropertiesV2(ctx context.Context, types ...hcsschema.PropertyType) (*hcsschema.Properties, error)
PropertiesV2 returns properties relating to the job container. This is an HCS construct but to adhere to the interface for containers on Windows it is partially implemented. The only supported property is schema2.PTStatistics.
func (*JobContainer) Release ¶
func (c *JobContainer) Release(ctx context.Context) error
Release unmounts all of the container layers. Safe to call multiple times, if no storage is mounted this call will just return nil.
func (*JobContainer) Shutdown ¶
func (c *JobContainer) Shutdown(ctx context.Context) error
Shutdown gracefully shuts down the container.
func (*JobContainer) Start ¶
func (c *JobContainer) Start(ctx context.Context) error
Start starts the container. There's nothing to "start" for job containers, so this just sets the start timestamp.
func (*JobContainer) Terminate ¶
func (c *JobContainer) Terminate(ctx context.Context) error
Terminate terminates the job object (kills every process in the job).
func (*JobContainer) Wait ¶
func (c *JobContainer) Wait() error
Wait synchronously waits for the container to shutdown or terminate. If the container has already exited returns the previous error (if any).
func (*JobContainer) WaitChannel ¶ added in v0.8.25
func (c *JobContainer) WaitChannel() <-chan struct{}
func (*JobContainer) WaitError ¶ added in v0.8.25
func (c *JobContainer) WaitError() error
type JobProcess ¶
type JobProcess struct {
// contains filtered or unexported fields
}
JobProcess represents a process run in a job object.
func (*JobProcess) Close ¶
func (p *JobProcess) Close() error
Close cleans up any state associated with the process but does not kill it.
func (*JobProcess) CloseStderr ¶ added in v0.8.17
func (p *JobProcess) CloseStderr(ctx context.Context) error
CloseStderr closes the stderr pipe of the process.
func (*JobProcess) CloseStdin ¶
func (p *JobProcess) CloseStdin(ctx context.Context) error
CloseStdin closes the stdin pipe of the process.
func (*JobProcess) CloseStdout ¶ added in v0.8.17
func (p *JobProcess) CloseStdout(ctx context.Context) error
CloseStdout closes the stdout pipe of the process.
func (*JobProcess) ExitCode ¶
func (p *JobProcess) ExitCode() (int, error)
ExitCode returns the exit code of the process.
func (*JobProcess) Kill ¶
func (p *JobProcess) Kill(ctx context.Context) (bool, error)
Kill signals the process to terminate. Returns a bool signifying whether the signal was successfully delivered.
func (*JobProcess) ResizeConsole ¶
func (p *JobProcess) ResizeConsole(ctx context.Context, width, height uint16) error
func (*JobProcess) Signal ¶
func (p *JobProcess) Signal(ctx context.Context, options interface{}) (bool, error)
Signal sends a signal to the process and returns whether the signal was delivered.
func (*JobProcess) Wait ¶
func (p *JobProcess) Wait() error
Wait waits for the process to exit. If the process has already exited returns the previous error (if any).