containerinit

package
v0.0.0-...-b359386 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const SharedPath = "/.container-shared"

Variables

View Source
var SocketPath = filepath.Join(SharedPath, "rpc.sock")

Functions

func Main

func Main()

该代码运行在容器内,以便为了在运行实际进程之前安装环境

Types

type Client

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

func NewClient

func NewClient(path string) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) DiscoverdDeregister

func (c *Client) DiscoverdDeregister() error

func (*Client) GetPtyMaster

func (c *Client) GetPtyMaster() (*os.File, error)

func (*Client) GetState

func (c *Client) GetState() (State, error)

func (*Client) GetStdin

func (c *Client) GetStdin() (*os.File, error)

func (*Client) GetStreams

func (c *Client) GetStreams() (*os.File, *os.File, *os.File, error)

func (*Client) Resume

func (c *Client) Resume() error

func (*Client) Signal

func (c *Client) Signal(signal int) error

func (*Client) StreamState

func (c *Client) StreamState() <-chan *StateChange

type Config

type Config struct {
	Uid       *uint32
	Gid       *uint32
	Gateway   string
	Hostname  string
	WorkDir   string
	MAC       string
	IP        string
	TTY       bool
	OpenStdin bool
	Env       map[string]string
	Args      []string
	Ports     []host.Port
	Resources resource.Resources
	LogLevel  log15.Lvl
}

type ContainerInit

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

func (*ContainerInit) DiscoverdDeregister

func (c *ContainerInit) DiscoverdDeregister(arg, res *struct{}) error

func (*ContainerInit) GetPtyMaster

func (c *ContainerInit) GetPtyMaster(arg struct{}, fd *fdrpc.FD) error

func (*ContainerInit) GetState

func (c *ContainerInit) GetState(arg *struct{}, status *State) error

func (*ContainerInit) GetStdin

func (c *ContainerInit) GetStdin(arg struct{}, f *os.File) error

func (*ContainerInit) GetStreams

func (c *ContainerInit) GetStreams(arg struct{}, fds *[]fdrpc.FD) error

func (*ContainerInit) Resume

func (c *ContainerInit) Resume(arg, res *struct{}) error

func (*ContainerInit) Signal

func (c *ContainerInit) Signal(sig int, res *struct{}) error

func (*ContainerInit) StreamState

func (c *ContainerInit) StreamState(arg struct{}, stream rpcplus.Stream) error

type State

type State byte
const (
	StateInitial State = iota
	StateRunning
	StateExited
	StateFailed
)

容器状态

func (State) String

func (s State) String() string

type StateChange

type StateChange struct {
	State      State
	Error      string
	ExitStatus int
}

Jump to

Keyboard shortcuts

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