Documentation ¶
Index ¶
- func Register(create func() Backend)
- func WithCriLogFile(criLogFile *os.File) func(*Option)
- func WithDiscard() func(*Option)
- func WithHijack(hi http.Hijacker, upgrade bool) func(*Option)
- func WithID(id string) func(*Option)
- func WithMemBuffer(memBuffer *bytes.Buffer) func(*Option)
- func WithRawFile() func(*Option)
- func WithRootDir(dir string) func(*Option)
- func WithStdinHijack() func(*Option)
- func WithStdinStream() func(*Option)
- func WithStreams(streams *remotecommand.Streams) func(*Option)
- type Backend
- type Cache
- type ContainerIO
- type IO
- type Option
- type StreamType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCriLogFile ¶
WithCriLogFile specified the cri log file backend.
func WithHijack ¶
WithHijack specified the hijack backend.
func WithMemBuffer ¶
WithMemBuffer specified the memory buffer backend.
func WithRootDir ¶
WithRootDir specified the container's root dir.
func WithStdinHijack ¶
func WithStdinHijack() func(*Option)
WithStdinHijack sepcified the stdin with hijack.
func WithStdinStream ¶
func WithStdinStream() func(*Option)
WithStdinStream specified the stdin with stream.
func WithStreams ¶
func WithStreams(streams *remotecommand.Streams) func(*Option)
WithStreams specified the stream backend.
Types ¶
type Backend ¶
type Backend interface { // Name defines the backend's name. Name() string // Init initializes the backend io. Init(opt *Option) error // Out returns the stdout. Out() io.Writer // In returns the stdin. In() io.Reader // Err returns the stderr. Err() io.Writer // Close closes the io. Close() error }
Backend defines the real output/input of the container's stdio.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache saves the all container's io.
type ContainerIO ¶
type ContainerIO struct { Option // contains filtered or unexported fields }
ContainerIO used to control the container's stdio.
func (*ContainerIO) Close ¶
func (cio *ContainerIO) Close() error
Close implements the standard Close interface.
func (*ContainerIO) OpenStdin ¶
func (cio *ContainerIO) OpenStdin() bool
OpenStdin returns open container's stdin or not.
type IO ¶
type IO struct { Stdout *ContainerIO Stderr *ContainerIO Stdin *ContainerIO }
IO wraps the three container's ios of stdout, stderr, stdin.
func (*IO) AddBackend ¶
AddBackend adds more backends to container's stdio.
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option is used to pass some data into ContainerIO.
type StreamType ¶
type StreamType string
StreamType is the type of the stream.
const ( // Stdin stream type. Stdin StreamType = "stdin" // Stdout stream type. Stdout StreamType = "stdout" // Stderr stream type. Stderr StreamType = "stderr" )