Documentation
¶
Index ¶
- Constants
- func CGroupNsId(options ...Option) (uint32, error)
- func Execute(ctx context.Context, runnable Runnable, options ...Option) error
- func HTTP(options ...Option) (*http.Client, error)
- func MountNsId(options ...Option) (uint32, error)
- func NetNsId(options ...Option) (uint32, error)
- func NewReader(filename string, options ...Option) (io.ReadCloser, error)
- func NewWriter(filename string, flag int, perm os.FileMode, options ...Option) (io.WriteCloser, error)
- func PidNsId(options ...Option) (uint32, error)
- func ReadFile(name string, options ...Option) ([]byte, error)
- func Stat(name string, options ...Option) (os.FileInfo, error)
- func UserNsId(options ...Option) (uint32, error)
- func UtsNsId(options ...Option) (uint32, error)
- func WriteFile(name string, data []byte, perm os.FileMode, options ...Option) error
- type Command
- type Lambda
- type NsType
- type Option
- type Runnable
- type Scanner
Constants ¶
const ( MNT = syscall.CLONE_NEWNS UTS = syscall.CLONE_NEWUTS IPC = syscall.CLONE_NEWIPC USER = syscall.CLONE_NEWUSER NET = syscall.CLONE_NEWNET PID = syscall.CLONE_NEWPID )
Variables ¶
This section is empty.
Functions ¶
func CGroupNsId ¶
CGroupNsId reads cgroup namespace inode for specified process id and host procfs
func NewReader ¶
func NewReader(filename string, options ...Option) (io.ReadCloser, error)
NewReader creates a namespace file reader, which reads file from mount namespace bind with process id(host pid namespace) and host procfs
func NewWriter ¶
func NewWriter(filename string, flag int, perm os.FileMode, options ...Option) (io.WriteCloser, error)
NewWriter creates a namespace file writer, which write file to mount namespace bind with process id(host pid namespace) and host procfs
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func Procfs ¶
Procfs specify host procfs, which is useful for using package in container that has bind host /proc into container or starts with host pid namespace
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner represents a namespace file scanner which return a line for each Next() call
func NewScanner ¶
NewScanner creates a namespace file scanner, which reads lines of specified file from mount namespace bind with process id(host pid namespace) and host procfs