model

package
v0.0.0-...-5c47c4c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: EPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BufferSize = 8192

	// method names to send events with information about exec to the clients.
	OnExecExit  = "onExecExit"
	OnExecError = "onExecError"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerInfo

type ContainerInfo struct {
	PodName       string `json:"pod"`
	ContainerName string `json:"container"`
}

type ExecErrorEvent

type ExecErrorEvent struct {
	event.E `json:"-"`

	ExecId int    `json:"id"`
	Stack  string `json:"stack"`
}

func (*ExecErrorEvent) Type

func (*ExecErrorEvent) Type() string

type ExecExitEvent

type ExecExitEvent struct {
	event.E `json:"-"`

	ExecId int `json:"id"`
}

func (*ExecExitEvent) Type

func (*ExecExitEvent) Type() string

type InitConfigParams

type InitConfigParams struct {
	ContainerName    string `json:"container"` // optional, Will be first suitable container in pod if not set
	KubeConfigParams `json:"kubeconfig"`
}

type KubeConfigParams

type KubeConfigParams struct {
	Namespace   string `json:"namespace"`   //optional, Is not set into kubeconfig file if is not set or empty
	Username    string `json:"username"`    //optional, Developer in kubeconfig if empty
	BearerToken string `json:"bearertoken"` //evaluated from header
}

type MachineExec

type MachineExec struct {
	Identifier MachineIdentifier `json:"identifier"`
	Cmd        []string          `json:"cmd"`
	// Supported values for now 'shell', "", "process". If type is empty "", then type will resolved like "shell".
	Type string `json:"type"`

	Tty  bool   `json:"tty"`
	Cols int    `json:"cols"`
	Rows int    `json:"rows"`
	Cwd  string `json:"cwd"`

	ExitChan  chan bool
	ErrorChan chan error

	// unique client id, real execId should be hidden from client to prevent serialization
	ID int `json:"id"`

	ws_conn.ConnectionHandler

	MsgChan chan []byte

	// Todo Refactoring: this code is kubernetes specific. Create separated code layer and move it.
	Executor remotecommand.Executor
	SizeChan chan remotecommand.TerminalSize

	// Todo Refactoring: Create separated code layer and move it.
	Buffer *line_buffer.LineRingBuffer

	// BearerToken to have access to the kubernetes api.
	// For empty value will be created in-cluster config with service account access.
	BearerToken string
}

Todo code Refactoring: MachineExec should be simple object for exec creation, without any business logic

type MachineIdentifier

type MachineIdentifier struct {
	MachineName string `json:"machineName"`
}

type ResolvedExec

type ResolvedExec struct {
	ContainerInfo
	Cmd []string `json:"cmd"`
}

ResolvedExec holds info client might send to create exec

Jump to

Keyboard shortcuts

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