clustershim

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package clustershim implements a grpc server for handling clustercontroller requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShimHandler

type ShimHandler map[string]handler.Handler

ShimHandler is a handler map of a shim server. The key is Destination field in ShimRequest, and the value is the corresponding handler.

type ShimServer

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

ShimServer handles requests and transmits to corresponding shim handler.

func NewShimServer

func NewShimServer() *ShimServer

NewShimServer creates a new shimServer.

func (*ShimServer) Close

func (s *ShimServer) Close()

Close gracefully stops shim server.

func (*ShimServer) ClusterName

func (s *ShimServer) ClusterName() string

ClusterName returns the cluster name.

func (*ShimServer) Do

Do handles the requests and transmits to corresponding server.

func (*ShimServer) DoControlMultiRequest

func (s *ShimServer) DoControlMultiRequest(in *clustermessage.ClusterMessage) error

func (*ShimServer) DoControlRequest

func (*ShimServer) RegisterHandler

func (s *ShimServer) RegisterHandler(name string, h handler.Handler)

RegisterHandler registers shim handler.

func (*ShimServer) SendChan

func (s *ShimServer) SendChan() chan clustermessage.ClusterMessage

SendChan returns the channel that save messages need to be reported.

func (*ShimServer) Serve

func (s *ShimServer) Serve(addr string) error

Serve starts a grpc server over unix socket.

type ShimServiceClient

type ShimServiceClient interface {
	Do(in *clustermessage.ClusterMessage) (*clustermessage.ClusterMessage, error)
	ReturnChan() <-chan *clustermessage.ClusterMessage
}

ShimServiceClient is the client interface to a cluster shim.

func NewRemoteShimClient

func NewRemoteShimClient(shimClientName, addr string) ShimServiceClient

NewRemoteShimClient returns a remote shim client which is connecting to addr.

func NewlocalShimClient

func NewlocalShimClient(c *config.ClusterControllerConfig) ShimServiceClient

NewlocalShimClient returns a local shim client with default handler.

func NewlocalShimClientWithHandler

func NewlocalShimClientWithHandler(handlers ShimHandler) ShimServiceClient

NewlocalShimClientWithHandler returns a local shim client with given handlers.

Directories

Path Synopsis
apis
v1
Package handler provides the ability to interact with k8s or third-party services.
Package handler provides the ability to interact with k8s or third-party services.

Jump to

Keyboard shortcuts

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