ioctrl

package
v0.0.0-...-e2521e0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ForsedShutdown = errors.New("Forsed Shutdown")

Functions

func BorderMessage

func BorderMessage(lines ...string) string

func NewDuplexPipe

func NewDuplexPipe() (*DuplexPipe, *DuplexPipe)

func ProxyReadWriter

func ProxyReadWriter(proxied io.ReadWriter) io.ReadWriteCloser

Types

type CopyMonitor

type CopyMonitor struct {
	Close context.CancelFunc
	Done  func() <-chan struct{}
	// contains filtered or unexported fields
}

func NewCopyMonitor

func NewCopyMonitor(ctx context.Context, opts ...Option) (cm *CopyMonitor, err error)

func (*CopyMonitor) AddCopier

func (cm *CopyMonitor) AddCopier(dst io.Writer, src io.Reader)

func (*CopyMonitor) Status

func (cm *CopyMonitor) Status() (done, isCorrect bool, err error)

type DuplexPipe

type DuplexPipe struct {
	io.ReadWriteCloser
	// contains filtered or unexported fields
}

func (*DuplexPipe) Close

func (dp *DuplexPipe) Close() error

func (*DuplexPipe) Read

func (dp *DuplexPipe) Read(p []byte) (n int, err error)

func (*DuplexPipe) Write

func (dp *DuplexPipe) Write(p []byte) (n int, err error)

type Option

type Option func(*CopyMonitor) error

func BufSize

func BufSize(size int) Option

func NotificationChanel

func NotificationChanel(ch <-chan struct{}) Option

func UpdateInterval

func UpdateInterval(interval time.Duration) Option

Jump to

Keyboard shortcuts

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