sys

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SIGABRT   = Signal(syscall.SIGABRT)
	SIGALRM   = Signal(syscall.SIGALRM)
	SIGBUS    = Signal(syscall.SIGBUS)
	SIGCHLD   = Signal(syscall.SIGCHLD)
	SIGCLD    = Signal(syscall.SIGCLD)
	SIGCONT   = Signal(syscall.SIGCONT)
	SIGFPE    = Signal(syscall.SIGFPE)
	SIGHUP    = Signal(syscall.SIGHUP)
	SIGILL    = Signal(syscall.SIGILL)
	SIGINT    = Signal(syscall.SIGINT)
	SIGIO     = Signal(syscall.SIGIO)
	SIGIOT    = Signal(syscall.SIGIOT)
	SIGKILL   = Signal(syscall.SIGKILL)
	SIGPIPE   = Signal(syscall.SIGPIPE)
	SIGPOLL   = Signal(syscall.SIGPOLL)
	SIGPROF   = Signal(syscall.SIGPROF)
	SIGPWR    = Signal(syscall.SIGPWR)
	SIGQUIT   = Signal(syscall.SIGQUIT)
	SIGSEGV   = Signal(syscall.SIGSEGV)
	SIGSTOP   = Signal(syscall.SIGSTOP)
	SIGSYS    = Signal(syscall.SIGSYS)
	SIGTERM   = Signal(syscall.SIGTERM)
	SIGTRAP   = Signal(syscall.SIGTRAP)
	SIGTSTP   = Signal(syscall.SIGTSTP)
	SIGTTIN   = Signal(syscall.SIGTTIN)
	SIGTTOU   = Signal(syscall.SIGTTOU)
	SIGURG    = Signal(syscall.SIGURG)
	SIGUSR1   = Signal(syscall.SIGUSR1)
	SIGUSR2   = Signal(syscall.SIGUSR2)
	SIGVTALRM = Signal(syscall.SIGVTALRM)
	SIGWINCH  = Signal(syscall.SIGWINCH)
	SIGXCPU   = Signal(syscall.SIGXCPU)
	SIGXFSZ   = Signal(syscall.SIGXFSZ)
)

Variables

View Source
var (
	ErrUnknownSignal = errors.New("unknown signal")
)

Functions

func CloneFile added in v0.4.0

func CloneFile(f CloneableFile) (*os.File, error)

func FormatVersion added in v0.4.0

func FormatVersion(v Version, format VersionFormat) string

func FullDuplexCopy added in v0.4.0

func FullDuplexCopy(ctx context.Context, left io.ReadWriter, right io.ReadWriter, opts *FullDuplexCopyOpts) (rErr error)

func IsBinaryCompatibleWithHost added in v0.4.0

func IsBinaryCompatibleWithHost(binaryOs Os, binaryArch Arch, hostOs Os, hostArch Arch) bool

func IsClosedError added in v0.4.0

func IsClosedError(err error) bool

func IsNotExist

func IsNotExist(err error) bool

func VersionToMap added in v0.4.0

func VersionToMap(v Version) map[string]any

Types

type Arch added in v0.4.0

type Arch uint8
const (
	ArchUnknown Arch = iota
	Arch386
	ArchAmd64
	ArchArmV6
	ArchArmV7
	ArchArm64
	ArchMips64Le
	ArchRiscV64
)

func (Arch) Bare added in v0.4.0

func (this Arch) Bare() string

func (Arch) IsEqualTo added in v0.4.0

func (this Arch) IsEqualTo(other any) bool

func (Arch) IsZero added in v0.4.0

func (this Arch) IsZero() bool

func (Arch) MarshalText added in v0.4.0

func (this Arch) MarshalText() ([]byte, error)

func (Arch) Oci added in v0.4.0

func (this Arch) Oci() string

func (*Arch) Set added in v0.4.0

func (this *Arch) Set(plain string) error

func (*Arch) SetOci added in v0.4.0

func (this *Arch) SetOci(plain string) error

func (Arch) String added in v0.4.0

func (this Arch) String() string

func (*Arch) UnmarshalText added in v0.4.0

func (this *Arch) UnmarshalText(in []byte) error

type CloneableFile added in v0.4.0

type CloneableFile interface {
	Fd() uintptr
	Name() string
}

type CloseWriter added in v0.4.0

type CloseWriter interface {
	CloseWrite() error
}

type EnvVars

type EnvVars map[string]string

func (*EnvVars) Add

func (this *EnvVars) Add(in ...string)

func (*EnvVars) AddAllOf

func (this *EnvVars) AddAllOf(in EnvVars)

func (EnvVars) Clone

func (this EnvVars) Clone() EnvVars

func (*EnvVars) Set

func (this *EnvVars) Set(kOrV ...string)

func (*EnvVars) String

func (this *EnvVars) String() string

func (*EnvVars) Strings

func (this *EnvVars) Strings() []string

type FileMode

type FileMode fs.FileMode

func (FileMode) MarshalText

func (this FileMode) MarshalText() ([]byte, error)

func (*FileMode) Set

func (this *FileMode) Set(in string) error

func (FileMode) String

func (this FileMode) String() string

func (*FileMode) UnmarshalText

func (this *FileMode) UnmarshalText(in []byte) error

type FullDuplexCopyOpts added in v0.4.0

type FullDuplexCopyOpts struct {
	OnStart       func()
	OnEnd         func(l2r, r2l int64, duration time.Duration, err error, wasInL2r *bool)
	OnStreamStart func(isL2r bool)
	OnStreamEnd   func(isL2r bool, err error)
}

type Os added in v0.4.0

type Os uint8
const (
	OsUnknown Os = iota
	OsLinux
	OsWindows
)

func (Os) IsEqualTo added in v0.4.0

func (this Os) IsEqualTo(other any) bool

func (Os) IsZero added in v0.4.0

func (this Os) IsZero() bool

func (Os) MarshalText added in v0.4.0

func (this Os) MarshalText() ([]byte, error)

func (*Os) Set added in v0.4.0

func (this *Os) Set(plain string) error

func (*Os) SetOci added in v0.4.0

func (this *Os) SetOci(plain string) error

func (Os) String added in v0.4.0

func (this Os) String() string

func (*Os) UnmarshalText added in v0.4.0

func (this *Os) UnmarshalText(in []byte) error

type Signal

type Signal uint16

func (*Signal) DecodeMsgPack added in v0.4.0

func (this *Signal) DecodeMsgPack(dec codec.MsgPackDecoder) error

func (*Signal) DecodeMsgpack added in v0.4.0

func (this *Signal) DecodeMsgpack(dec *msgpack.Decoder) (err error)

func (Signal) EncodeMsgPack added in v0.4.0

func (this Signal) EncodeMsgPack(enc codec.MsgPackEncoder) error

func (Signal) EncodeMsgpack added in v0.4.0

func (this Signal) EncodeMsgpack(enc *msgpack.Encoder) error

func (Signal) IsEqualTo

func (this Signal) IsEqualTo(other any) bool

func (Signal) IsZero

func (this Signal) IsZero() bool

func (Signal) MarshalText

func (this Signal) MarshalText() ([]byte, error)

func (Signal) Native

func (this Signal) Native() syscall.Signal

func (Signal) SendToProcess added in v0.4.0

func (this Signal) SendToProcess(p *os.Process) error

func (*Signal) Set

func (this *Signal) Set(plain string) error

func (Signal) String

func (this Signal) String() string

func (*Signal) UnmarshalText

func (this *Signal) UnmarshalText(text []byte) error

type Version added in v0.4.0

type Version interface {
	Title() string
	Version() string
	Revision() string
	Edition() VersionEdition
	BuildAt() time.Time
	Vendor() string
	GoVersion() string
	Os() Os
	Arch() Arch
	Features() VersionFeatures
}

type VersionEdition added in v0.4.0

type VersionEdition uint8
const (
	VersionEditionUnknown VersionEdition = iota
	VersionEditionGeneric
	VersionEditionExtended
)

func (*VersionEdition) Set added in v0.4.0

func (this *VersionEdition) Set(plain string) error

func (VersionEdition) String added in v0.4.0

func (this VersionEdition) String() string

type VersionFeature added in v0.4.0

type VersionFeature interface {
	Name() string
}

type VersionFeatureCategory added in v0.4.0

type VersionFeatureCategory interface {
	Name() string
	ForEach(func(VersionFeature))
}

type VersionFeatures added in v0.4.0

type VersionFeatures interface {
	ForEach(func(VersionFeatureCategory))
}

type VersionFormat added in v0.4.0

type VersionFormat uint8
const (
	VersionFormatShort VersionFormat = iota
	VersionFormatLong
)

Jump to

Keyboard shortcuts

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