Documentation ¶
Overview ¶
Package handler provides the ability to interact with k8s or third-party services.
Index ¶
- func ControlTaskResponse(status int, body string) []byte
- func GetControlMultiTaskFromClusterMessage(msg *clustermessage.ClusterMessage) *clustermessage.ControlMultiTask
- func GetControllerTaskFromClusterMessage(msg *clustermessage.ClusterMessage) *clustermessage.ControllerTask
- func Response(body []byte, head *clustermessage.MessageHead) *clustermessage.ClusterMessage
- type Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControlTaskResponse ¶
ControlTaskResponse packages the body message to clustermessage.ControllerTaskResponse and serialize it.
func GetControlMultiTaskFromClusterMessage ¶
func GetControlMultiTaskFromClusterMessage( msg *clustermessage.ClusterMessage) *clustermessage.ControlMultiTask
func GetControllerTaskFromClusterMessage ¶
func GetControllerTaskFromClusterMessage( msg *clustermessage.ClusterMessage) *clustermessage.ControllerTask
func Response ¶
func Response(body []byte, head *clustermessage.MessageHead) *clustermessage.ClusterMessage
Response packages the body message to clustermessage.ClusterMessage.
Types ¶
type Handler ¶
type Handler interface { // Do handle the request and transmit to corresponding server. Do(*clustermessage.ClusterMessage) (*clustermessage.ClusterMessage, error) }
Handler is shim handler interface that contains the methods required to interact to remote server.
func NewHTTPProxyHandler ¶
NewHTTPProxyHandler returns a new httpProxyHandler.
func NewK8sHandler ¶
func NewK8sHandler(cl kubernetes.Interface) Handler
NewK8sHandler returns a new k8sHandler.
Click to show internal directories.
Click to hide internal directories.