package namespaces
import "github.com/docker/libcontainer/namespaces"
Index ¶
- Variables
- func Exec(container *libcontainer.Config, term Terminal, rootfs, dataPath string, args []string, createCommand CreateCommand, startCallback func()) (int, error)
- func GetNamespaceFlags(namespaces map[string]bool) (flag int)
- func Init(container *libcontainer.Config, uncleanRootfs, consolePath string, syncPipe *SyncPipe, args []string) error
- func InitializeNetworking(container *libcontainer.Config, nspid int, pipe *SyncPipe) error
- func SetupCgroups(container *libcontainer.Config, nspid int) (cgroups.ActiveCgroup, error)
- type CreateCommand
- type Namespace
- type Namespaces
- type StdTerminal
- func (s *StdTerminal) Attach(command *exec.Cmd) error
- func (s *StdTerminal) Close() error
- func (s *StdTerminal) Resize(h, w int) error
- func (s *StdTerminal) SetMaster(*os.File)
- type SyncPipe
- func NewSyncPipeFromFd(parentFd, childFd uintptr) (*SyncPipe, error)
- func (s *SyncPipe) Child() *os.File
- func (s *SyncPipe) Close() error
- func (s *SyncPipe) CloseChild()
- func (s *SyncPipe) Parent() *os.File
- func (s *SyncPipe) ReadFromChild() error
- func (s *SyncPipe) ReadFromParent() (*network.NetworkState, error)
- func (s *SyncPipe) ReportChildError(err error)
- func (s *SyncPipe) SendToChild(networkState *network.NetworkState) error
- type Terminal
- type TtyTerminal
Variables ¶
var ( ErrUnkownNamespace = errors.New("Unknown namespace") ErrUnsupported = errors.New("Unsupported method") )
namespaceList is used to convert the libcontainer types into the names of the files located in /proc/<pid>/ns/* for each namespace
Functions ¶
func Exec ¶
func Exec(container *libcontainer.Config, term Terminal, rootfs, dataPath string, args []string, createCommand CreateCommand, startCallback func()) (int, error)
func GetNamespaceFlags ¶
func Init ¶
func Init(container *libcontainer.Config, uncleanRootfs, consolePath string, syncPipe *SyncPipe, args []string) error
func InitializeNetworking ¶
func InitializeNetworking(container *libcontainer.Config, nspid int, pipe *SyncPipe) error
func SetupCgroups ¶
func SetupCgroups(container *libcontainer.Config, nspid int) (cgroups.ActiveCgroup, error)
Types ¶
type CreateCommand ¶
type CreateCommand func(container *libcontainer.Config, console, rootfs, dataPath, init string, childPipe *os.File, args []string) *exec.Cmd
type Namespace ¶
type Namespace struct { Key string `json:"key,omitempty"` Value int `json:"value,omitempty"` File string `json:"file,omitempty"` }
func GetNamespace ¶
func (*Namespace) String ¶
type Namespaces ¶
type Namespaces []*Namespace
func (Namespaces) Contains ¶
func (n Namespaces) Contains(ns string) bool
Contains returns true if the specified Namespace is in the slice
func (Namespaces) Get ¶
func (n Namespaces) Get(ns string) *Namespace
type StdTerminal ¶
type StdTerminal struct {
// contains filtered or unexported fields
}
func (*StdTerminal) Attach ¶
func (s *StdTerminal) Attach(command *exec.Cmd) error
func (*StdTerminal) Close ¶
func (s *StdTerminal) Close() error
func (*StdTerminal) Resize ¶
func (s *StdTerminal) Resize(h, w int) error
func (*StdTerminal) SetMaster ¶
func (s *StdTerminal) SetMaster(*os.File)
type SyncPipe ¶
type SyncPipe struct {
// contains filtered or unexported fields
}
SyncPipe allows communication to and from the child processes to it's parent and allows the two independent processes to syncronize their state.
func NewSyncPipeFromFd ¶
func (*SyncPipe) Child ¶
func (*SyncPipe) Close ¶
func (*SyncPipe) CloseChild ¶
func (s *SyncPipe) CloseChild()
func (*SyncPipe) Parent ¶
func (*SyncPipe) ReadFromChild ¶
func (*SyncPipe) ReadFromParent ¶
func (s *SyncPipe) ReadFromParent() (*network.NetworkState, error)
func (*SyncPipe) ReportChildError ¶
func (*SyncPipe) SendToChild ¶
func (s *SyncPipe) SendToChild(networkState *network.NetworkState) error
type Terminal ¶
type Terminal interface { io.Closer SetMaster(*os.File) Attach(*exec.Cmd) error Resize(h, w int) error }
func NewTerminal ¶
type TtyTerminal ¶
type TtyTerminal struct {
// contains filtered or unexported fields
}
func (*TtyTerminal) Attach ¶
func (t *TtyTerminal) Attach(command *exec.Cmd) error
func (*TtyTerminal) Close ¶
func (t *TtyTerminal) Close() error
func (*TtyTerminal) Resize ¶
func (t *TtyTerminal) Resize(h, w int) error
func (*TtyTerminal) SetMaster ¶
func (t *TtyTerminal) SetMaster(master *os.File)
Source Files ¶
create.go std_term.go sync_pipe.go term.go tty_term.go types.go unsupported.go
- Version
- v1.1.0
- Published
- Jun 26, 2014
- Platform
- js/wasm
- Imports
- 12 packages
- Last checked
- 2 hours ago –
Tools for package owners.