services

package
v0.1.0-M4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0, EPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Service ID of the container management gRPC service
	ContainersServiceID = "container-management.grpc.v1.service-containers"
	// Service ID of the system information gRPC service
	SystemInfoServiceID = "container-management.grpc.v1.service-systemInfo"
)

Service IDs used to enable configurability and discovery between the different services using the internal daemon's registry

View Source
const (
	// MaxBufSize is the maximum buffer size (in bytes) received in a read chunk or sent in a write chunk.
	MaxBufSize = 2 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader reads from a byte stream.

func NewReader

func NewReader(ctx context.Context, containerID string, stdIn bool, readServer pbcontainers.Containers_AttachServer) (*Reader, error)

NewReader creates a new Reader to read a resource.

func NewReaderAt

func NewReaderAt(ctx context.Context, containerID string, stdIn bool, readServer pbcontainers.Containers_AttachServer, offset int64) (*Reader, error)

NewReaderAt creates a new Reader to read a resource from the given offset.

func (*Reader) Close

func (r *Reader) Close() error

Close implements io.Closer.

func (*Reader) ContainerID

func (r *Reader) ContainerID() string

ContainerID gets the container id of the IO this Reader is reading.

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

Read implements io.Reader. Read buffers received bytes that do not fit in p.

func (*Reader) StdIn

func (r *Reader) StdIn() bool

StdIn gets whether the IO should be Interactive.

type Writer

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

Writer writes to a byte stream.

func NewWriter

func NewWriter(ctx context.Context, containerID string, stdIn bool, writeServer pbcontainers.Containers_AttachServer) (*Writer, error)

NewWriter creates a new Writer to write a resource.

resourceName specifies the name of the resource. The resource will be available after Close has been called.

It is the caller's responsibility to call Close when writing is done.

TODO: There is currently no way to resume a write. Maybe NewWriter should begin with a call to QueryWriteStatus.

func (*Writer) Close

func (w *Writer) Close() error

Close implements io.Closer. It is the caller's responsibility to call Close() when writing is done.

func (*Writer) ContainerID

func (w *Writer) ContainerID() string

ContainerID gets the container ID of the IO this Writer is writing.

func (*Writer) StdIn

func (w *Writer) StdIn() bool

StdIn checks whether the IO should be attached to STDIN also - i.e. interaction is enabled.

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Write implements io.Writer.

Jump to

Keyboard shortcuts

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