containerio

package
v0.0.0-...-932d068 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFIFOSet

func NewFIFOSet(processID string, withStdin bool, withTerminal bool) (*cio.FIFOSet, error)

NewFIFOSet prepares fifo files.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache saves the all container's io.

func NewCache

func NewCache() *Cache

NewCache creates a container's io storage.

func (*Cache) Get

func (c *Cache) Get(id string) *IO

Get reads a container's io by id.

func (*Cache) Put

func (c *Cache) Put(id string, io *IO) error

Put writes a container's io into storage.

func (*Cache) Remove

func (c *Cache) Remove(id string)

Remove removes the container's io.

type IO

type IO struct {
	// contains filtered or unexported fields
}

IO represents the streams and logger.

func NewIO

func NewIO(id string, withStdin bool) *IO

NewIO return IO instance.

func (*IO) AttachCRILog

func (ctrio *IO) AttachCRILog(path string, withTerminal bool) error

AttachCRILog will create CRILog and register it into stream.

func (*IO) Close

func (ctrio *IO) Close() error

Close closes the stream and the logger.

func (*IO) InitContainerIO

func (ctrio *IO) InitContainerIO(dio *cio.DirectIO) (cio.IO, error)

InitContainerIO will start logger and coping data from fifo.

func (*IO) Reset

func (ctrio *IO) Reset()

Reset reset the logdriver.

func (*IO) SetLogDriver

func (ctrio *IO) SetLogDriver(logdriver logger.LogDriver)

SetLogDriver sets log driver to the IO.

func (*IO) SetMaxBufferSize

func (ctrio *IO) SetMaxBufferSize(maxBufferSize int64)

SetMaxBufferSize set the max size of buffer.

func (*IO) SetNonBlock

func (ctrio *IO) SetNonBlock(nonBlock bool)

SetNonBlock whether to cache the container's logs with buffer.

func (*IO) Stream

func (ctrio *IO) Stream() *streams.Stream

Stream is used to export the stream field.

func (*IO) Wait

func (ctrio *IO) Wait()

Wait wait for coping-data job.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL