Documentation ¶
Index ¶
- type MockTunnel
- func (m *MockTunnel) DeleteNode(nodeName string)
- func (m *MockTunnel) FetchHealthData(nodeName string) error
- func (m *MockTunnel) GetBizUniqueKey(container *corev1.Container) string
- func (m *MockTunnel) Key() string
- func (m *MockTunnel) OnNodeNotReady(nodeName string)
- func (m *MockTunnel) PutNode(ctx context.Context, nodeName string, node Node)
- func (m *MockTunnel) QueryAllBizStatusData(nodeName string) error
- func (m *MockTunnel) Ready() bool
- func (m *MockTunnel) RegisterCallback(OnBaseDiscovered OnBaseDiscovered, OnBaseStatusArrived OnBaseStatusArrived, ...)
- func (m *MockTunnel) RegisterNode(initData model.NodeInfo)
- func (m *MockTunnel) Start(clientID string, env string) error
- func (m *MockTunnel) StartBiz(nodeName, podKey string, container *corev1.Container) error
- func (m *MockTunnel) StopBiz(nodeName, podKey string, container *corev1.Container) error
- func (m *MockTunnel) UnRegisterNode(nodeName string)
- func (m *MockTunnel) UpdateBizStatus(nodeName, containerKey string, data model.BizStatusData)
- type Node
- type OnAllBizStatusArrived
- type OnBaseDiscovered
- type OnBaseStatusArrived
- type OnSingleBizStatusArrived
- type Tunnel
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 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
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 }
Click to show internal directories.
Click to hide internal directories.