node

package
v0.0.0-...-8d5db88 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyImageBetweenNodes

func CopyImageBetweenNodes(
	ctx context.Context,
	sourceState *NodeState,
	destState *NodeState,
	image string,
	cb func(ctx context.Context, reader io.ReadCloser) error,
) error

Types

type LocalNodeExec

type LocalNodeExec struct {
}

func NewLocalNodeExec

func NewLocalNodeExec() *LocalNodeExec

func (*LocalNodeExec) Close

func (l *LocalNodeExec) Close() error

func (*LocalNodeExec) ExecuteCommand

func (l *LocalNodeExec) ExecuteCommand(
	command string,
	env map[string]string,
	onStdout func(string),
	onStderr func(string),
) error

func (*LocalNodeExec) ExecuteOutput

func (l *LocalNodeExec) ExecuteOutput(command string, env map[string]string) (string, string, error)

func (*LocalNodeExec) Init

func (l *LocalNodeExec) Init() error

func (*LocalNodeExec) ReadFile

func (l *LocalNodeExec) ReadFile(path string) ([]byte, error)

func (*LocalNodeExec) WriteFile

func (l *LocalNodeExec) WriteFile(path string, data []byte) error

type NodeExec

type NodeExec interface {
	Init() error
	Close() error
	WriteFile(path string, data []byte) error
	ReadFile(path string) ([]byte, error)
	ExecuteOutput(command string, env map[string]string) (string, string, error)
	ExecuteCommand(
		command string,
		env map[string]string,
		onStdout func(string),
		onStderr func(string),
	) error
}

type NodeManager

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

func NewNodeManager

func NewNodeManager() *NodeManager

func (*NodeManager) AddOrGetNode

func (m *NodeManager) AddOrGetNode(node *model.Node) (*NodeState, error)

func (*NodeManager) RemoveNode

func (m *NodeManager) RemoveNode(nodeID int64) error

type NodeState

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

func (*NodeState) Close

func (n *NodeState) Close() error

func (*NodeState) GetDockerClient

func (n *NodeState) GetDockerClient() (*dockerClient.Client, error)

func (*NodeState) GetExec

func (n *NodeState) GetExec() (NodeExec, error)

func (*NodeState) GetNodeID

func (n *NodeState) GetNodeID() int64

func (*NodeState) GetNodeInfo

func (n *NodeState) GetNodeInfo() string

type RemoteNodeExec

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

func NewRemoteNodeExec

func NewRemoteNodeExec(node *model.Node) *RemoteNodeExec

func (*RemoteNodeExec) Close

func (r *RemoteNodeExec) Close() error

func (*RemoteNodeExec) ExecuteCommand

func (r *RemoteNodeExec) ExecuteCommand(
	command string,
	env map[string]string,
	onStdout func(string),
	onStderr func(string),
) error

func (*RemoteNodeExec) ExecuteOutput

func (r *RemoteNodeExec) ExecuteOutput(command string, env map[string]string) (string, string, error)

func (*RemoteNodeExec) Init

func (r *RemoteNodeExec) Init() error

func (*RemoteNodeExec) ReadFile

func (r *RemoteNodeExec) ReadFile(path string) ([]byte, error)

func (*RemoteNodeExec) WriteFile

func (r *RemoteNodeExec) WriteFile(path string, data []byte) error

Jump to

Keyboard shortcuts

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