client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerBox

type DockerBox struct {
	Template *schema.BoxV1

	// TODO look for better design than callbacks
	OnSetupCallback       func()
	OnCreateCallback      func(port schema.PortV1)
	OnExecCallback        func()
	OnCloseCallback       func()
	OnCloseErrorCallback  func(error, string)
	OnStreamErrorCallback func(error, string) // TODO replace with error channel
	// contains filtered or unexported fields
}

func NewDockerBox

func NewDockerBox(template *schema.BoxV1) (*DockerBox, error)

don't forget to invoke "defer dockerClient.Close()"

func (*DockerBox) Close

func (box *DockerBox) Close() error

func (*DockerBox) Create

func (box *DockerBox) Create(containerName string) (string, error)

func (*DockerBox) Exec

func (box *DockerBox) Exec(containerId string, streams *model.BoxStreams) error

TODO set bash in the config

func (*DockerBox) Setup

func (box *DockerBox) Setup() error

type KubeBox

type KubeBox struct {
	Template        *schema.BoxV1
	ResourceOptions *ResourceOptions

	// TODO look for better design than callbacks
	OnSetupCallback       func(string)
	OnTunnelCallback      func(port schema.PortV1)
	OnTunnelErrorCallback func(error, string)
	OnExecCallback        func()
	OnCloseCallback       func(string)
	OnCloseErrorCallback  func(error, string)
	// contains filtered or unexported fields
}

func NewInClusterKubeBox

func NewInClusterKubeBox(template *schema.BoxV1, resourceOptions *ResourceOptions) (*KubeBox, error)

func NewOutOfClusterKubeBox

func NewOutOfClusterKubeBox(template *schema.BoxV1, configPath string, resourceOptions *ResourceOptions) (*KubeBox, error)

func (*KubeBox) ApplyTemplate

func (box *KubeBox) ApplyTemplate(deploymentSpec *appsv1.Deployment, serviceSpec *corev1.Service) error

func (*KubeBox) BuildSpec

func (box *KubeBox) BuildSpec(containerName string) (*appsv1.Deployment, *corev1.Service, error)

func (*KubeBox) Exec

func (box *KubeBox) Exec(pod *corev1.Pod, streams *model.BoxStreams) error

func (*KubeBox) ExecWithoutTerminal

func (box *KubeBox) ExecWithoutTerminal(pod *corev1.Pod, streams *model.BoxStreams) error

func (*KubeBox) GetPod

func (box *KubeBox) GetPod(deployment *appsv1.Deployment) (*corev1.Pod, error)

func (*KubeBox) PortForward

func (box *KubeBox) PortForward(pod *corev1.Pod)

func (*KubeBox) RemoveTemplate

func (box *KubeBox) RemoveTemplate(deployment *appsv1.Deployment, service *corev1.Service)

type Labels

type Labels map[string]string

type ResourceOptions

type ResourceOptions struct {
	Namespace string
	Memory    string
	Cpu       string
}

Jump to

Keyboard shortcuts

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