lxd: github.com/lxc/lxd/shared Index | Files | Directories

package shared

import "github.com/lxc/lxd/shared"

Index

Package Files

archive_linux.go cert.go cgo.go container.go json.go network.go network_unix.go proxy.go util.go util_linux.go util_linux_cgo.go util_unix.go

Constants

const ABSTRACT_UNIX_SOCK_LEN int = C.ABSTRACT_UNIX_SOCK_LEN
const DefaultPort = "8443"
const POLLERR int = C.POLLERR
const POLLHUP int = C.POLLHUP
const POLLIN int = C.POLLIN
const POLLNVAL int = C.POLLNVAL
const POLLPRI int = C.POLLPRI
const POLLRDHUP int = C.POLLRDHUP
const SnapshotDelimiter = "/"

Variables

var KnownContainerConfigKeys = map[string]func(value string) error{
    "boot.autostart":             IsBool,
    "boot.autostart.delay":       IsInt64,
    "boot.autostart.priority":    IsInt64,
    "boot.stop.priority":         IsInt64,
    "boot.host_shutdown_timeout": IsInt64,

    "limits.cpu": func(value string) error {
        if value == "" {
            return nil
        }

        match, _ := regexp.MatchString("^[-,0-9]*$", value)
        if !match {
            return fmt.Errorf("Invalid CPU limit syntax")
        }

        if strings.HasPrefix(value, "-") || strings.HasPrefix(value, ",") {
            return fmt.Errorf("CPU limit can't start with a separator")
        }

        if strings.HasSuffix(value, "-") || strings.HasSuffix(value, ",") {
            return fmt.Errorf("CPU limit can't end with a separator")
        }

        return nil
    },
    "limits.cpu.allowance": func(value string) error {
        if value == "" {
            return nil
        }

        if strings.HasSuffix(value, "%") {

            _, err := strconv.Atoi(strings.TrimSuffix(value, "%"))
            if err != nil {
                return err
            }

            return nil
        }

        fields := strings.SplitN(value, "/", 2)
        if len(fields) != 2 {
            return fmt.Errorf("Invalid allowance: %s", value)
        }

        _, err := strconv.Atoi(strings.TrimSuffix(fields[0], "ms"))
        if err != nil {
            return err
        }

        _, err = strconv.Atoi(strings.TrimSuffix(fields[1], "ms"))
        if err != nil {
            return err
        }

        return nil
    },
    "limits.cpu.priority": IsPriority,

    "limits.disk.priority": IsPriority,

    "limits.memory": func(value string) error {
        if value == "" {
            return nil
        }

        if strings.HasSuffix(value, "%") {
            _, err := strconv.ParseInt(strings.TrimSuffix(value, "%"), 10, 64)
            if err != nil {
                return err
            }

            return nil
        }

        _, err := units.ParseByteSizeString(value)
        if err != nil {
            return err
        }

        return nil
    },
    "limits.memory.enforce": func(value string) error {
        return IsOneOf(value, []string{"soft", "hard"})
    },
    "limits.memory.swap":          IsBool,
    "limits.memory.swap.priority": IsPriority,

    "limits.network.priority": IsPriority,

    "limits.processes": IsInt64,

    "linux.kernel_modules": IsAny,

    "migration.incremental.memory":            IsBool,
    "migration.incremental.memory.iterations": IsUint32,
    "migration.incremental.memory.goal":       IsUint32,

    "nvidia.runtime":             IsBool,
    "nvidia.driver.capabilities": IsAny,
    "nvidia.require.cuda":        IsAny,
    "nvidia.require.driver":      IsAny,

    "security.nesting":       IsBool,
    "security.privileged":    IsBool,
    "security.devlxd":        IsBool,
    "security.devlxd.images": IsBool,

    "security.protection.delete": IsBool,
    "security.protection.shift":  IsBool,

    "security.idmap.base":     IsUint32,
    "security.idmap.isolated": IsBool,
    "security.idmap.size":     IsUint32,

    "security.syscalls.blacklist_default":       IsBool,
    "security.syscalls.blacklist_compat":        IsBool,
    "security.syscalls.blacklist":               IsAny,
    "security.syscalls.intercept.mknod":         IsBool,
    "security.syscalls.intercept.mount":         IsBool,
    "security.syscalls.intercept.mount.allowed": IsAny,
    "security.syscalls.intercept.mount.fuse":    IsAny,
    "security.syscalls.intercept.mount.shift":   IsBool,
    "security.syscalls.intercept.setxattr":      IsBool,
    "security.syscalls.whitelist":               IsAny,

    "snapshots.schedule": func(value string) error {
        if value == "" {
            return nil
        }

        if len(strings.Split(value, " ")) != 5 {
            return fmt.Errorf("Schedule must be of the form: <minute> <hour> <day-of-month> <month> <day-of-week>")
        }

        _, err := cron.Parse(fmt.Sprintf("* %s", value))
        if err != nil {
            return errors.Wrap(err, "Error parsing schedule")
        }

        return nil
    },
    "snapshots.schedule.stopped": IsBool,
    "snapshots.pattern":          IsAny,
    "snapshots.expiry": func(value string) error {

        _, err := GetSnapshotExpiry(time.Time{}, value)
        return err
    },

    "raw.apparmor": IsAny,
    "raw.lxc":      IsAny,
    "raw.seccomp":  IsAny,
    "raw.idmap":    IsAny,

    "volatile.apply_template":   IsAny,
    "volatile.base_image":       IsAny,
    "volatile.last_state.idmap": IsAny,
    "volatile.last_state.power": IsAny,
    "volatile.idmap.base":       IsAny,
    "volatile.idmap.current":    IsAny,
    "volatile.idmap.next":       IsAny,
    "volatile.apply_quota":      IsAny,
}

KnownContainerConfigKeys maps all fully defined, well-known config keys to an appropriate checker function, which validates whether or not a given value is syntactically legal.

var ObjectFound = fmt.Errorf("Found requested object")
var WebsocketUpgrader = websocket.Upgrader{
    CheckOrigin: func(r *http.Request) bool { return true },
}

func AddSlash Uses

func AddSlash(path string) string

AddSlash adds a slash to the end of paths if they don't already have one. This can be useful for rsyncing things, since rsync has behavior present on the presence or absence of a trailing slash.

func AllocatePort Uses

func AllocatePort() (int, error)

AllocatePort asks the kernel for a free open port that is ready to use

func AtoiEmptyDefault Uses

func AtoiEmptyDefault(s string, def int) (int, error)

func CachePath Uses

func CachePath(path ...string) string

CachePath returns the directory that LXD should its cache under. If LXD_DIR is set, this path is $LXD_DIR/cache, otherwise it is /var/cache/lxd.

func CertFingerprint Uses

func CertFingerprint(cert *x509.Certificate) string

func CertFingerprintStr Uses

func CertFingerprintStr(c string) (string, error)

func ConfigKeyChecker Uses

func ConfigKeyChecker(key string) (func(value string) error, error)

ConfigKeyChecker returns a function that will check whether or not a provide value is valid for the associate config key. Returns an error if the key is not known. The checker function only performs syntactic checking of the value, semantic and usage checking must be done by the caller. User defined keys are always considered to be valid, e.g. user.* and environment.* keys.

func ContainerGetParentAndSnapshotName Uses

func ContainerGetParentAndSnapshotName(name string) (string, string, bool)

ContainerGetParentAndSnapshotName returns the parent container name, snapshot name, and whether it actually was a snapshot name.

func DebugJson Uses

func DebugJson(r *bytes.Buffer)

func DeepCopy Uses

func DeepCopy(src, dest interface{}) error

DeepCopy copies src to dest by using encoding/gob so its not that fast.

func DefaultWriter Uses

func DefaultWriter(conn *websocket.Conn, w io.WriteCloser, writeDone chan<- bool)

func DetectCompression Uses

func DetectCompression(fname string) ([]string, string, []string, error)

func DetectCompressionFile Uses

func DetectCompressionFile(f io.ReadSeeker) ([]string, string, []string, error)

func DeviceTotalMemory Uses

func DeviceTotalMemory() (int64, error)

func DirCopy Uses

func DirCopy(source string, dest string) error

DirCopy copies a directory recursively, overwriting the target if it exists.

func DownloadFileHash Uses

func DownloadFileHash(httpClient *http.Client, useragent string, progress func(progress ioprogress.ProgressData), canceler *cancel.Canceler, filename string, url string, hash string, hashFunc hash.Hash, target io.WriteSeeker) (int64, error)

func EscapePathFstab Uses

func EscapePathFstab(path string) string

EscapePathFstab escapes a path fstab-style. This ensures that getmntent_r() and friends can correctly parse stuff like /some/wacky path with spaces /some/wacky target with spaces

func ExecReaderToChannel Uses

func ExecReaderToChannel(r io.Reader, bufferSize int, exited <-chan bool, fd int) <-chan []byte

Extensively commented directly in the code. Please leave the comments! Looking at this in a couple of months noone will know why and how this works anymore.

func FileCopy Uses

func FileCopy(source string, dest string) error

FileCopy copies a file, overwriting the target if it exists.

func FileMove Uses

func FileMove(oldPath string, newPath string) error

FileMove tries to move a file by using os.Rename, if that fails it tries to copy the file and remove the source.

func FindOrGenCert Uses

func FindOrGenCert(certf string, keyf string, certtype bool, addHosts bool) error

FindOrGenCert generates a keypair if needed. The type argument is false for server, true for client.

func GenCert Uses

func GenCert(certf string, keyf string, certtype bool, addHosts bool) error

GenCert will create and populate a certificate file and a key file

func GenerateMemCert Uses

func GenerateMemCert(client bool, addHosts bool) ([]byte, []byte, error)

GenerateMemCert creates client or server certificate and key pair, returning them as byte arrays in memory.

func GetAllXattr Uses

func GetAllXattr(path string) (xattrs map[string]string, err error)

GetAllXattr retrieves all extended attributes associated with a file, directory or symbolic link.

func GetErrno Uses

func GetErrno(err error) (errno error, iserrno bool)

Detect whether err is an errno.

func GetFileStat Uses

func GetFileStat(p string) (uid int, gid int, major uint32, minor uint32, inode uint64, nlink int, err error)

func GetOwnerMode Uses

func GetOwnerMode(fInfo os.FileInfo) (os.FileMode, int, int)

func GetPathMode Uses

func GetPathMode(path string) (os.FileMode, error)

GetPathMode returns a os.FileMode for the provided path

func GetPollRevents Uses

func GetPollRevents(fd int, timeout int, flags int) (int, int, error)

func GetRemoteCertificate Uses

func GetRemoteCertificate(address string) (*x509.Certificate, error)

func GetRootDiskDevice Uses

func GetRootDiskDevice(devices map[string]map[string]string) (string, map[string]string, error)

GetRootDiskDevice returns the container device that is configured as root disk

func GetSnapshotExpiry Uses

func GetSnapshotExpiry(refDate time.Time, s string) (time.Time, error)

func GetTLSConfig Uses

func GetTLSConfig(tlsClientCertFile string, tlsClientKeyFile string, tlsClientCAFile string, tlsRemoteCert *x509.Certificate) (*tls.Config, error)

func GetTLSConfigMem Uses

func GetTLSConfigMem(tlsClientCert string, tlsClientKey string, tlsClientCA string, tlsRemoteCertPEM string, insecureSkipVerify bool) (*tls.Config, error)

func GroupId Uses

func GroupId(name string) (int, error)

GroupId is an adaption from https://codereview.appspot.com/4589049.

func HostPath Uses

func HostPath(path string) string

HostPath returns the host path for the provided path On a normal system, this does nothing When inside of a snap environment, returns the real path

func InitTLSConfig Uses

func InitTLSConfig() *tls.Config

InitTLSConfig returns a tls.Config populated with default encryption parameters. This is used as baseline config for both client and server certificates used by LXD.

func Int64InSlice Uses

func Int64InSlice(key int64, list []int64) bool

func IntInSlice Uses

func IntInSlice(key int, list []int) bool

func IsAny Uses

func IsAny(value string) error

func IsBlockdev Uses

func IsBlockdev(fm os.FileMode) bool

func IsBlockdevPath Uses

func IsBlockdevPath(pathName string) bool

func IsBool Uses

func IsBool(value string) error

func IsDeviceID Uses

func IsDeviceID(value string) error

IsDeviceID validates string is four lowercase hex characters suitable as Vendor or Device ID.

func IsDir Uses

func IsDir(name string) bool

IsDir returns true if the given path is a directory.

func IsInt64 Uses

func IsInt64(value string) error

func IsLoopback Uses

func IsLoopback(iface *net.Interface) bool

func IsMountPoint Uses

func IsMountPoint(name string) bool

func IsNotEmpty Uses

func IsNotEmpty(value string) error

func IsOneOf Uses

func IsOneOf(value string, valid []string) error

func IsPriority Uses

func IsPriority(value string) error

func IsRootDiskDevice Uses

func IsRootDiskDevice(device map[string]string) bool

IsRootDiskDevice returns true if the given device representation is configured as root disk for a container. It typically get passed a specific entry of api.Container.Devices.

func IsSnapshot Uses

func IsSnapshot(name string) bool

func IsTrue Uses

func IsTrue(value string) bool

func IsUint32 Uses

func IsUint32(value string) error

func IsUint8 Uses

func IsUint8(value string) error

func IsUnixDev Uses

func IsUnixDev(path string) bool

func IsUnixSocket Uses

func IsUnixSocket(path string) bool

IsUnixSocket returns true if the given path is either a Unix socket or a symbolic link pointing at a Unix socket.

func LogPath Uses

func LogPath(path ...string) string

LogPath returns the directory that LXD should put logs under. If LXD_DIR is set, this path is $LXD_DIR/logs, otherwise it is /var/log/lxd.

func LookupUUIDByBlockDevPath Uses

func LookupUUIDByBlockDevPath(diskDevice string) (string, error)

func MkdirAllOwner Uses

func MkdirAllOwner(path string, perm os.FileMode, uid int, gid int) error

func NetworkGetCounters Uses

func NetworkGetCounters(ifName string) api.NetworkStateCounters

func OpenPty Uses

func OpenPty(uid, gid int64) (master *os.File, slave *os.File, err error)

func ParseLXDFileHeaders Uses

func ParseLXDFileHeaders(headers http.Header) (uid int64, gid int64, mode int, type_ string, write string)

func ParseMetadata Uses

func ParseMetadata(metadata interface{}) (map[string]interface{}, error)

func ParseNumberFromFile Uses

func ParseNumberFromFile(file string) (int64, error)

func PathExists Uses

func PathExists(name string) bool

func PathIsEmpty Uses

func PathIsEmpty(path string) (bool, error)

PathIsEmpty checks if the given path is empty.

func Pipe Uses

func Pipe() (master *os.File, slave *os.File, err error)

func ProxyFromConfig Uses

func ProxyFromConfig(httpsProxy string, httpProxy string, noProxy string) func(req *http.Request) (*url.URL, error)

func ProxyFromEnvironment Uses

func ProxyFromEnvironment(req *http.Request) (*url.URL, error)

This is basically the same as golang's ProxyFromEnvironment, except it doesn't fall back to http_proxy when https_proxy isn't around, which is incorrect behavior. It still respects HTTP_PROXY, HTTPS_PROXY, and NO_PROXY.

func RFC3493Dialer Uses

func RFC3493Dialer(network, address string) (net.Conn, error)

func RandomCryptoString Uses

func RandomCryptoString() (string, error)

Returns a random base64 encoded string from crypto/rand.

func ReadCert Uses

func ReadCert(fpath string) (*x509.Certificate, error)

func ReadStdin Uses

func ReadStdin() ([]byte, error)

func ReadToJSON Uses

func ReadToJSON(r io.Reader, req interface{}) error

func ReaderToChannel Uses

func ReaderToChannel(r io.Reader, bufferSize int) <-chan []byte

func RemoveDuplicatesFromString Uses

func RemoveDuplicatesFromString(s string, sep string) string

RemoveDuplicatesFromString removes all duplicates of the string 'sep' from the specified string 's'. Leading and trailing occurrences of sep are NOT removed (duplicate leading/trailing are). Performs poorly if there are multiple consecutive redundant separators.

func RenderTemplate Uses

func RenderTemplate(template string, ctx pongo2.Context) (string, error)

RenderTemplate renders a pongo2 template.

func RunCommand Uses

func RunCommand(name string, arg ...string) (string, error)

RunCommand runs a command with optional arguments and returns stdout. If the command fails to start or returns a non-zero exit code then an error is returned containing the output of stderr.

func RunCommandCLocale Uses

func RunCommandCLocale(name string, arg ...string) (string, error)

RunCommandCLocale runs a command with a LANG=C.UTF-8 environment set with optional arguments and returns stdout. If the command fails to start or returns a non-zero exit code then an error is returned containing the output of stderr.

func RunCommandSplit Uses

func RunCommandSplit(env []string, name string, arg ...string) (string, string, error)

RunCommandSplit runs a command with a supplied environment and optional arguments and returns the resulting stdout and stderr output as separate variables. If the supplied environment is nil then the default environment is used. If the command fails to start or returns a non-zero exit code then an error is returned containing the output of stderr too.

func RunCommandWithFds Uses

func RunCommandWithFds(stdin io.Reader, stdout io.Writer, name string, arg ...string) error

func RunningInUserNS Uses

func RunningInUserNS() bool

func SetProgressMetadata Uses

func SetProgressMetadata(metadata map[string]interface{}, stage, displayPrefix string, percent, processed, speed int64)

func SetSize Uses

func SetSize(fd int, width int, height int) (err error)

func SplitExt Uses

func SplitExt(fpath string) (string, string)

func Statvfs Uses

func Statvfs(path string) (*unix.Statfs_t, error)

func StringInSlice Uses

func StringInSlice(key string, list []string) bool

func StringMapHasStringKey Uses

func StringMapHasStringKey(m map[string]string, keys ...string) bool

StringMapHasStringKey returns true if any of the supplied keys are present in the map.

func TextEditor Uses

func TextEditor(inPath string, inContent []byte) ([]byte, error)

Spawn the editor with a temporary YAML file for editing configs

func TimeIsSet Uses

func TimeIsSet(ts time.Time) bool

func TryRunCommand Uses

func TryRunCommand(name string, arg ...string) (string, error)

func URLEncode Uses

func URLEncode(path string, query map[string]string) (string, error)

URLEncode encodes a path and query parameters to a URL.

func Unpack Uses

func Unpack(file string, path string, blockBackend bool, runningInUserns bool, tracker *ioprogress.ProgressTracker) error

func UserId Uses

func UserId(name string) (int, error)

UserId is an adaption from https://codereview.appspot.com/4589049.

func ValidHostname Uses

func ValidHostname(name string) bool

func VarPath Uses

func VarPath(path ...string) string

VarPath returns the provided path elements joined by a slash and appended to the end of $LXD_DIR, which defaults to /var/lib/lxd.

func WebsocketConsoleMirror Uses

func WebsocketConsoleMirror(conn *websocket.Conn, w io.WriteCloser, r io.ReadCloser) (chan bool, chan bool)

func WebsocketMirror Uses

func WebsocketMirror(conn *websocket.Conn, w io.WriteCloser, r io.ReadCloser, Reader WebSocketMirrorReader, Writer WebSocketMirrorWriter) (chan bool, chan bool)

func WebsocketProxy Uses

func WebsocketProxy(source *websocket.Conn, target *websocket.Conn) chan bool

func WebsocketRecvStream Uses

func WebsocketRecvStream(w io.Writer, conn *websocket.Conn) chan bool

func WebsocketSendStream Uses

func WebsocketSendStream(conn *websocket.Conn, r io.Reader, bufferSize int) chan bool

func WriteAll Uses

func WriteAll(w io.Writer, data []byte) error

func WriteTempFile Uses

func WriteTempFile(dir string, prefix string, content string) (string, error)

WriteTempFile creates a temp file with the specified content

type BytesReadCloser Uses

type BytesReadCloser struct {
    Buf *bytes.Buffer
}

func (BytesReadCloser) Close Uses

func (r BytesReadCloser) Close() error

func (BytesReadCloser) Read Uses

func (r BytesReadCloser) Read(b []byte) (n int, err error)

type CertInfo Uses

type CertInfo struct {
    // contains filtered or unexported fields
}

CertInfo captures TLS certificate information about a certain public/private keypair and an optional CA certificate.

Given LXD's support for PKI setups, these two bits of information are normally used and passed around together, so this structure helps with that (see doc/security.md for more details).

func KeyPairAndCA Uses

func KeyPairAndCA(dir, prefix string, kind CertKind, addHosts bool) (*CertInfo, error)

KeyPairAndCA returns a CertInfo object with a reference to the key pair and (optionally) CA certificate located in the given directory and having the given name prefix

The naming conversion for the various files is:

<prefix>.crt -> public key <prefix>.key -> private key <prefix>.ca -> CA certificate

If no public/private key files are found, a new key pair will be generated and saved on disk.

If a CA certificate is found, it will be returned as well as second return value (otherwise it will be nil).

func TestingAltKeyPair Uses

func TestingAltKeyPair() *CertInfo

TestingAltKeyPair returns CertInfo object initialized with a test keypair which differs from the one returned by TestCertInfo. It's meant to be used only by tests.

func TestingKeyPair Uses

func TestingKeyPair() *CertInfo

TestingKeyPair returns CertInfo object initialized with a test keypair. It's meant to be used only by tests.

func (*CertInfo) CA Uses

func (c *CertInfo) CA() *x509.Certificate

CA returns the CA certificate.

func (*CertInfo) Fingerprint Uses

func (c *CertInfo) Fingerprint() string

Fingerprint returns the fingerprint of the public key.

func (*CertInfo) KeyPair Uses

func (c *CertInfo) KeyPair() tls.Certificate

KeyPair returns the public/private key pair.

func (*CertInfo) PrivateKey Uses

func (c *CertInfo) PrivateKey() []byte

PrivateKey is a convenience to encode the underlying private key.

func (*CertInfo) PublicKey Uses

func (c *CertInfo) PublicKey() []byte

PublicKey is a convenience to encode the underlying public key to ASCII.

type CertKind Uses

type CertKind int

CertKind defines the kind of certificate to generate from scratch in KeyPairAndCA when it's not there.

The two possible kinds are client and server, and they differ in the ext-key-usage bitmaps. See GenerateMemCert for more details.

const (
    CertClient CertKind = iota
    CertServer
)

Possible kinds of certificates.

type ContainerAction Uses

type ContainerAction string
const (
    Stop     ContainerAction = "stop"
    Start    ContainerAction = "start"
    Restart  ContainerAction = "restart"
    Freeze   ContainerAction = "freeze"
    Unfreeze ContainerAction = "unfreeze"
)

type Jmap Uses

type Jmap map[string]interface{}

func (Jmap) GetBool Uses

func (m Jmap) GetBool(key string) (bool, error)

func (Jmap) GetInt Uses

func (m Jmap) GetInt(key string) (int, error)

func (Jmap) GetMap Uses

func (m Jmap) GetMap(key string) (Jmap, error)

func (Jmap) GetString Uses

func (m Jmap) GetString(key string) (string, error)

type ReadSeeker Uses

type ReadSeeker struct {
    io.Reader
    io.Seeker
}

func NewReadSeeker Uses

func NewReadSeeker(reader io.Reader, seeker io.Seeker) *ReadSeeker

func (*ReadSeeker) Read Uses

func (r *ReadSeeker) Read(p []byte) (n int, err error)

func (*ReadSeeker) Seek Uses

func (r *ReadSeeker) Seek(offset int64, whence int) (int64, error)

type RunError Uses

type RunError struct {
    Err    error
    Stdout string
    Stderr string
    // contains filtered or unexported fields
}

func (RunError) Error Uses

func (e RunError) Error() string

type Utsname Uses

type Utsname struct {
    Sysname    string
    Nodename   string
    Release    string
    Version    string
    Machine    string
    Domainname string
}

Utsname returns the same info as unix.Utsname, as strings

func Uname Uses

func Uname() (*Utsname, error)

Uname returns Utsname as strings

type WebSocketMirrorReader Uses

type WebSocketMirrorReader func(conn *websocket.Conn, r io.ReadCloser, readDone chan<- bool)

WebsocketMirror allows mirroring a reader to a websocket and taking the result and writing it to a writer. This function allows for multiple mirrorings and correctly negotiates stream endings. However, it means any websocket.Conns passed to it are live when it returns, and must be closed explicitly.

type WebSocketMirrorWriter Uses

type WebSocketMirrorWriter func(conn *websocket.Conn, w io.WriteCloser, writeDone chan<- bool)

type WebsocketIO Uses

type WebsocketIO struct {
    Conn *websocket.Conn
    // contains filtered or unexported fields
}

WebsocketIO is a wrapper implementing ReadWriteCloser on top of websocket

func (*WebsocketIO) Close Uses

func (w *WebsocketIO) Close() error

Close sends a control message indicating the stream is finished, but it does not actually close the socket.

func (*WebsocketIO) Read Uses

func (w *WebsocketIO) Read(p []byte) (n int, err error)

func (*WebsocketIO) Write Uses

func (w *WebsocketIO) Write(p []byte) (n int, err error)

Directories

PathSynopsis
apiPackage api contains Go structs for all LXD API objects
cancel
cmd
containerwriter
dnsutilPackage dnsutil copied from coredns project https://github.com/coredns/coredns/blob/master/plugin/pkg/dnsutil/reverse.go
eagain
generate
generate/db
generate/filePackage file contains helpers to write auto-generated Go source files.
generate/lex
i18n
idmap
ioprogress
log15
log15/stackPackage stack implements utilities to capture, manipulate, and format call stacks.
log15/term
logger
logging
netutils
osarch
simplestreams
subtestPackage subtest provides a backwards-compatible way to run subtests.
termios
units
version

Package shared imports 49 packages (graph) and is imported by 401 packages. Updated 2019-11-15. Refresh now. Tools for package owners.