Documentation ¶
Index ¶
Constants ¶
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 Client ¶
type Client interface { // Create a new container. Create(ctx context.Context, config *types.Container) (*types.Container, error) // Get the detailed information of container. Get(ctx context.Context, id string) (*types.Container, error) // List returns the list of containers matching the optional filters provided. List(ctx context.Context, filters ...Filter) ([]*types.Container, error) // Start a container. Start(ctx context.Context, id string) error // Stop a container. Stop(ctx context.Context, id string, stopOpts *types.StopOpts) error // Update a container. Update(ctx context.Context, id string, updateOpts *types.UpdateOpts) error // Attach to a container Attach(ctx context.Context, id string, stdin bool) (io.Writer, io.ReadCloser, error) // Restart restart a running container. Restart(ctx context.Context, id string, timeout int64) error // Pause a container. Pause(ctx context.Context, id string) error // Resumes a container. Resume(ctx context.Context, id string) error // Rename renames a container. Rename(ctx context.Context, id string, name string) error // Remove removes a container, it may be running or stopped and so on. Remove(ctx context.Context, id string, force bool) error ProjectInfo(ctx context.Context) (sysinfotypes.ProjectInfo, error) // Logs prints the logs for a container Logs(ctx context.Context, id string, tail int32) error // Dispose the client instance Dispose() error }
Client is the client API for gRPC API of the engine.
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, ctrClient pbcontainers.Containers_AttachClient) (*Reader, error)
NewReader creates a new Reader to read a resource.
func NewReaderAt ¶
func NewReaderAt(ctx context.Context, containerID string, stdIn bool, offset int64, ctrClient pbcontainers.Containers_AttachClient) (*Reader, error)
NewReaderAt creates a new Reader to read a resource from the given offset.
func (*Reader) ContainerID ¶
ContainerID gets the container id of the IO this Reader is reading.
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, ctrClient pbcontainers.Containers_AttachClient) (*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.
Note: There is currently no way to resume a writer. Maybe NewWriter should begin with a call to QueryWriteStatus.
func (*Writer) Close ¶
Close implements io.Closer. It is the caller's responsibility to call Close() when writing is done.
func (*Writer) ContainerID ¶
ContainerID gets the resource name this Writer is writing.