tunnel

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTunnel added in v0.2.0

type MockTunnel struct {
	sync.Mutex
	OnBaseDiscovered
	OnBaseStatusArrived
	OnSingleBizStatusArrived
	OnAllBizStatusArrived

	NodeNotReady map[string]bool
	// contains filtered or unexported fields
}

func (*MockTunnel) DeleteNode added in v0.2.0

func (m *MockTunnel) DeleteNode(nodeName string)

func (*MockTunnel) FetchHealthData added in v0.2.0

func (m *MockTunnel) FetchHealthData(nodeName string) error

func (*MockTunnel) GetBizUniqueKey added in v0.3.4

func (m *MockTunnel) GetBizUniqueKey(container *corev1.Container) string

func (*MockTunnel) Key added in v0.2.0

func (m *MockTunnel) Key() string

func (*MockTunnel) OnNodeNotReady added in v0.3.0

func (m *MockTunnel) OnNodeNotReady(nodeName string)

func (*MockTunnel) PutNode added in v0.2.0

func (m *MockTunnel) PutNode(ctx context.Context, nodeName string, node Node)

func (*MockTunnel) QueryAllBizStatusData added in v0.3.4

func (m *MockTunnel) QueryAllBizStatusData(nodeName string) error

func (*MockTunnel) Ready added in v0.2.0

func (m *MockTunnel) Ready() bool

func (*MockTunnel) RegisterCallback added in v0.2.0

func (m *MockTunnel) RegisterCallback(
	OnBaseDiscovered OnBaseDiscovered,
	OnBaseStatusArrived OnBaseStatusArrived,
	OnAllBizStatusArrived OnAllBizStatusArrived,
	OnSingleBizStatusArrived OnSingleBizStatusArrived)

func (*MockTunnel) RegisterNode added in v0.3.5

func (m *MockTunnel) RegisterNode(initData model.NodeInfo)

func (*MockTunnel) Start added in v0.2.0

func (m *MockTunnel) Start(clientID string, env string) error

func (*MockTunnel) StartBiz added in v0.3.4

func (m *MockTunnel) StartBiz(nodeName, podKey string, container *corev1.Container) error

func (*MockTunnel) StopBiz added in v0.3.4

func (m *MockTunnel) StopBiz(nodeName, podKey string, container *corev1.Container) error

func (*MockTunnel) UnRegisterNode added in v0.3.5

func (m *MockTunnel) UnRegisterNode(nodeName string)

func (*MockTunnel) UpdateBizStatus added in v0.3.4

func (m *MockTunnel) UpdateBizStatus(nodeName, containerKey string, data model.BizStatusData)

type Node added in v0.2.0

type Node struct {
	model.NodeInfo
	model.NodeStatusData
}

type OnAllBizStatusArrived added in v0.3.4

type OnAllBizStatusArrived func(string, []model.BizStatusData)

OnAllBizStatusArrived is the container status data callback, will update vpod status to k8s

type OnBaseDiscovered added in v0.3.5

type OnBaseDiscovered func(model.NodeInfo)

OnBaseDiscovered is the node discover callback, will start/stop a vnode depends on node state

type OnBaseStatusArrived added in v0.3.5

type OnBaseStatusArrived func(string, model.NodeStatusData)

OnBaseStatusArrived is the node health data callback, will update vnode status to k8s

type OnSingleBizStatusArrived added in v0.3.4

type OnSingleBizStatusArrived func(string, model.BizStatusData)

OnSingleBizStatusArrived is one container status data callback, will update container-vpod status to k8s

type Tunnel

type Tunnel interface {
	// Key is the identity of Tunnel, will set to node label for special usage
	Key() string

	// Start is the func of tunnel start, please call the callback functions after start
	Start(clientID string, env string) error

	// Ready is the func for check tunnel ready, should return true after tunnel start success
	Ready() bool

	// RegisterCallback is the init func of Tunnel, please complete callback register in this func
	RegisterCallback(OnBaseDiscovered, OnBaseStatusArrived, OnAllBizStatusArrived, OnSingleBizStatusArrived)

	// RegisterNode is the func call when a vnode start successfully, you can implement it on demand
	RegisterNode(initData model.NodeInfo)

	// UnRegisterNode is the func call when a vnode shutdown successfully, you can implement it on demand
	UnRegisterNode(nodeName string)

	// OnNodeNotReady is the func call when a vnode status turns to not ready, you can implement it on demand
	OnNodeNotReady(nodeName string)

	// FetchHealthData is the func call for vnode to fetch health data , you need to fetch health data and call OnBaseStatusArrived when data arrived
	FetchHealthData(nodeName string) error

	// QueryAllBizStatusData is the func call for vnode to fetch all containers status data , you need to fetch all containers status data and call OnAllBizStatusArrived when data arrived
	QueryAllBizStatusData(nodeName string) error

	// StartBiz is the func calls for vnode to start a biz instance, you need to start container and call OnStartBizResponseArrived when start complete with a response
	StartBiz(nodeName, podKey string, container *v1.Container) error

	// StopBiz is the func calls for vnode to shut down a container , you need to start to shut down container and call OnShutdownContainerResponseArrived when shut down process complete with a response
	StopBiz(nodeName, podKey string, container *v1.Container) error

	// GetBizUniqueKey is the func returns a unique key of a container in a pod, vnode will use this unique key to find target Container status
	GetBizUniqueKey(container *v1.Container) string
}

Jump to

Keyboard shortcuts

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