Documentation
¶
Overview ¶
Package transfer defines transfer types for container filesystem operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContainerFSTransferrer ¶
func NewContainerFSTransferrer(bundleDir string) ctransfer.Transferrer
NewContainerFSTransferrer returns a Transferrer that handles ContainerPath + ReadStream/WriteStream transfer pairs.
func NewEchoTransferrer ¶
func NewEchoTransferrer() ctransfer.Transferrer
NewEchoTransferrer returns a Transferrer that copies data from a ReadStream source to a WriteStream destination. This is useful for testing the streaming pipeline end-to-end.
Types ¶
type ContainerPath ¶
ContainerPath represents a path within a running container's filesystem. It acts as either a source or destination in a transfer operation, identifying the container and path for archive operations.
func (*ContainerPath) MarshalAny ¶
func (cf *ContainerPath) MarshalAny(ctx context.Context, sm streaming.StreamCreator) (typeurl.Any, error)
MarshalAny marshals the ContainerPath to a typeurl.Any.
func (*ContainerPath) UnmarshalAny ¶
func (cf *ContainerPath) UnmarshalAny(ctx context.Context, sg streaming.StreamGetter, a typeurl.Any) error
UnmarshalAny unmarshals a ContainerPath from a typeurl.Any.
type ReadStream ¶
type ReadStream struct {
MediaType string
// contains filtered or unexported fields
}
ReadStream carries data from the client to the server (import direction). The client sends data through the stream and the server reads it.
func NewReadStream ¶
func NewReadStream(r io.Reader, mediaType string) *ReadStream
NewReadStream creates a ReadStream that will send data from r to the server during marshaling.
func (*ReadStream) MarshalAny ¶
func (s *ReadStream) MarshalAny(ctx context.Context, sm streaming.StreamCreator) (typeurl.Any, error)
MarshalAny marshals the ReadStream, creating a streaming connection and starting a goroutine that sends data from the reader.
func (*ReadStream) Reader ¶
func (s *ReadStream) Reader(ctx context.Context) io.Reader
Reader returns an io.Reader that consumes data sent by the client.
func (*ReadStream) UnmarshalAny ¶
func (s *ReadStream) UnmarshalAny(ctx context.Context, sg streaming.StreamGetter, a typeurl.Any) error
UnmarshalAny unmarshals a ReadStream from a typeurl.Any, recovering the stream from the StreamGetter.
type WriteStream ¶
type WriteStream struct {
MediaType string
// contains filtered or unexported fields
}
WriteStream carries data from the server to the client (export direction). The server writes data into the stream and the client receives it.
func NewWriteStream ¶
func NewWriteStream(w io.WriteCloser, mediaType string) *WriteStream
NewWriteStream creates a WriteStream that will receive data from the server into w during marshaling.
func (*WriteStream) MarshalAny ¶
func (s *WriteStream) MarshalAny(ctx context.Context, sm streaming.StreamCreator) (typeurl.Any, error)
MarshalAny marshals the WriteStream, creating a streaming connection and starting a goroutine that receives data into the writer.
func (*WriteStream) UnmarshalAny ¶
func (s *WriteStream) UnmarshalAny(ctx context.Context, sg streaming.StreamGetter, a typeurl.Any) error
UnmarshalAny unmarshals a WriteStream from a typeurl.Any, recovering the stream from the StreamGetter.
func (*WriteStream) Writer ¶
func (s *WriteStream) Writer(ctx context.Context) io.WriteCloser
Writer returns an io.WriteCloser that sends data to the client.