types

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	// common
	ID, Name       string
	Image, Command string
	State, Status  string // "running"  "Up 13 minutes"
	IPs            []string
	Shell          string

	// k8s
	PodName, ContainerName string
	Namespace, RunningNode string

	// remote location server address
	// use this to locate the container
	// in the proxy mode
	LocServer string

	// exec commands in arguments
	// permit user to execute any command
	// in that container
	Exec ExecOptions
}

Container instance

type ContainerAct added in v0.1.7

type ContainerAct int
const (
	EXEC ContainerAct = iota
	LOGS
)

type ContainerActionMessage added in v0.1.4

type ContainerActionMessage struct {
	Error   string `json:"err"`
	Code    int    `json:"code"`
	Message string `json:"msg"`
}

ContainerActionMessage tells the web browser the action's status

type Containers added in v0.1.5

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

func (*Containers) Append added in v0.1.5

func (cs *Containers) Append(c Container)

func (*Containers) Find added in v0.1.5

func (cs *Containers) Find(cID string) Container

func (*Containers) Len added in v0.1.5

func (cs *Containers) Len() int

func (*Containers) List added in v0.1.9

func (cs *Containers) List() []Container

func (*Containers) Set added in v0.1.5

func (cs *Containers) Set(containers []Container)

func (*Containers) SetShell added in v0.1.5

func (cs *Containers) SetShell(cID, shell string)

type ExecOptions added in v0.1.9

type ExecOptions struct {
	User string
	Env  string
	Cmd  string
	// alias as `p`
	Privileged bool
}

type InitMessage added in v0.1.5

type InitMessage struct {
	Arguments string `json:"Arguments,omitempty"`
	AuthToken string `json:"AuthToken,omitempty"`
}

type LogOptions added in v0.1.7

type LogOptions struct {
	ID     string
	Follow bool
	Tail   string
}

type MasterTTY added in v0.1.10

type MasterTTY struct {
	TTY
	// contains filtered or unexported fields
}

func NewMasterTTY added in v0.1.10

func NewMasterTTY(ctx context.Context, t TTY, execID string) (*MasterTTY, error)

func (*MasterTTY) Close added in v0.1.10

func (m *MasterTTY) Close() error

func (*MasterTTY) Fork added in v0.1.10

func (m *MasterTTY) Fork(ctx context.Context, collaborate bool) *SlaveTTY

func (*MasterTTY) Read added in v0.1.10

func (m *MasterTTY) Read(p []byte) (n int, err error)

func (*MasterTTY) Write added in v0.1.10

func (m *MasterTTY) Write(p []byte) (n int, err error)

type SlaveTTY added in v0.1.10

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

func (*SlaveTTY) Close added in v0.1.10

func (s *SlaveTTY) Close() error

func (*SlaveTTY) Read added in v0.1.10

func (s *SlaveTTY) Read(p []byte) (int, error)

func (*SlaveTTY) Write added in v0.1.10

func (s *SlaveTTY) Write(p []byte) (int, error)

type TTY added in v0.1.5

type TTY interface {
	webtty.Slave
	Exit() error
	// ActiveChan is to notify that the connection is active
	ActiveChan() <-chan struct{}
}

TTY is webtty.Slave with some additional methods.

Jump to

Keyboard shortcuts

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