Documentation
¶
Index ¶
- Constants
- Variables
- func DiskId2Name(id int) string
- func Mount(src, dst string) error
- func RandStr(strSize int, randType string) string
- func SetReadonly(path string) error
- func SocketConnect(addr string) (net.Conn, error)
- func Umount(root string)
- func UnixSocketConnect(addr string) (conn net.Conn, err error)
- type BytesPipe
Constants ¶
View Source
const ( UNIX_SOCKET_PREFIX = "unix://" VSOCK_SOCKET_PREFIX = "vsock://" )
Variables ¶
View Source
var ( // ErrClosed is returned when Write is called on a closed BytesPipe. ErrClosed = errors.New("write to closed BytesPipe") )
Functions ¶
func DiskId2Name ¶
func SetReadonly ¶ added in v0.7.0
Types ¶
type BytesPipe ¶ added in v1.0.0
type BytesPipe struct {
// contains filtered or unexported fields
}
BytesPipe is io.ReadWriteCloser which works similarly to pipe(queue). All written data may be read at most once. Also, BytesPipe allocates and releases new byte slices to adjust to current needs, so the buffer won't be overgrown after peak loads.
func NewBytesPipe ¶ added in v1.0.0
func NewBytesPipe() *BytesPipe
NewBytesPipe creates new BytesPipe, initialized by specified slice. If buf is nil, then it will be initialized with slice which cap is 64. buf will be adjusted in a way that len(buf) == 0, cap(buf) == cap(buf).
func (*BytesPipe) Close ¶ added in v1.0.0
Close causes further reads from a BytesPipe to return immediately.
func (*BytesPipe) CloseWithError ¶ added in v1.0.0
CloseWithError causes further reads from a BytesPipe to return immediately.
Click to show internal directories.
Click to hide internal directories.