Documentation
¶
Index ¶
- Constants
- Variables
- func CompressionFromExt(path string) (string, error)
- func CopyNotify(dst io.Writer, src io.Reader) chan error
- func DeleteIOSlave(pid *uint32)
- func ExtForCompression(compression string) (string, error)
- func IsPipe(fd uintptr) (bool, error)
- func NewCompressionReader(reader io.Reader, compression string) (io.ReadCloser, error)
- func NewCompressionWriter(writer io.Writer, compression string) (io.WriteCloser, error)
- func NewStreamIOMaster(slave grpc.BidiStreamingClient[daemon.AttachReq, daemon.AttachResp]) (stdIn *StreamIOWriter, stdOut *StreamIOReader, stdErr *StreamIOReader, ...)
- func NewStreamIOSlave(ctx context.Context, wg *sync.WaitGroup, pid uint32, exitCode <-chan int) (stdIn *StreamIOReader, stdOut *StreamIOWriter, stdErr *StreamIOWriter)
- func ReadFrom(src io.Reader, dst *os.File, compression string) (n int64, err error)
- func SetIOSlave(pid uint32, slave *StreamIOSlave)
- func SetIOSlavePID(oldId uint32, pid *uint32)
- func Splice(srcFd, dstFd uintptr) (int64, error)
- func Tar(src string, dst io.Writer, compression string) (err error)
- func Untar(src io.Reader, dest string, compression string) (err error)
- func WriteTo(src *os.File, dst io.Writer, compression string) (n int64, err error)
- type NopReadCloser
- type NopWriteCloser
- type Storage
- type StreamIOMaster
- type StreamIOReader
- type StreamIOSlave
- type StreamIOWriter
Constants ¶
const ( BYTE = 1.0 << (10 * iota) KIBIBYTE MEBIBYTE GIBIBYTE )
const CHUNK_SIZE = 4 * MEBIBYTE
Variables ¶
Functions ¶
func CompressionFromExt ¶ added in v0.9.238
func CopyNotify ¶ added in v0.9.244
CopyNotify asynchronously does io.Copy, notifying when done.
func DeleteIOSlave ¶
func DeleteIOSlave(pid *uint32)
DeleteIOSlave deletes the slave associated with a PID. Uses the PID value of pointer at the time of the call.
func ExtForCompression ¶ added in v0.9.238
func NewCompressionReader ¶ added in v0.9.238
func NewCompressionWriter ¶ added in v0.9.238
func NewStreamIOMaster ¶
func NewStreamIOMaster( slave grpc.BidiStreamingClient[daemon.AttachReq, daemon.AttachResp], ) (stdIn *StreamIOWriter, stdOut *StreamIOReader, stdErr *StreamIOReader, exitCode chan int, errors chan error)
func NewStreamIOSlave ¶
func NewStreamIOSlave( ctx context.Context, wg *sync.WaitGroup, pid uint32, exitCode <-chan int, ) (stdIn *StreamIOReader, stdOut *StreamIOWriter, stdErr *StreamIOWriter)
func ReadFrom ¶ added in v0.9.244
ReadFrom reads the contents of the src and writes it to the provided target. The function automatically detects the compression format from the file extension.
func SetIOSlave ¶
func SetIOSlave(pid uint32, slave *StreamIOSlave)
SetIOSlave sets the slave associated with a PID.
func SetIOSlavePID ¶
SetIOSlavePID updates the PID of an existing slave. Uses the PID value of pointer at the time of the call.
func Splice ¶ added in v0.9.238
Splice copies data from srcFd to dstFd using the splice system call, until EOF is reached. which moves data between two file descriptors without copying it b/w kernel and user space. One of the file descriptors must be a pipe. Check out splice(2) man page for more information.
func Tar ¶ added in v0.9.244
Tar creates a tarball from the provided sources and writes it to the destination. FIXME: Works only with files, not directories in the tarball.
Types ¶
type NopReadCloser ¶ added in v0.9.238
func (NopReadCloser) Close ¶ added in v0.9.238
func (NopReadCloser) Close() error
type NopWriteCloser ¶ added in v0.9.238
func (NopWriteCloser) Close ¶ added in v0.9.238
func (NopWriteCloser) Close() error
type StreamIOMaster ¶
type StreamIOMaster struct {
// contains filtered or unexported fields
}
type StreamIOReader ¶
type StreamIOSlave ¶
type StreamIOSlave struct {
PID uint32
// contains filtered or unexported fields
}
func GetIOSlave ¶
func GetIOSlave(pid uint32) *StreamIOSlave
GetIOSlave returns the slave associated with a PID.
func (*StreamIOSlave) Attach ¶
func (s *StreamIOSlave) Attach( ctx context.Context, master grpc.BidiStreamingServer[daemon.AttachReq, daemon.AttachResp], ) error
Attach attaches a master stream to the slave.
type StreamIOWriter ¶
type StreamIOWriter struct {
io.WriteCloser
io.ReaderFrom
// contains filtered or unexported fields
}
func (*StreamIOWriter) Close ¶
func (s *StreamIOWriter) Close() error