Documentation ¶
Overview ¶
Package clustershim implements a grpc server for handling clustercontroller requests.
Index ¶
- type ShimHandler
- type ShimServer
- func (s *ShimServer) Close()
- func (s *ShimServer) ClusterName() string
- func (s *ShimServer) Do(in *clustermessage.ClusterMessage) (*clustermessage.ClusterMessage, error)
- func (s *ShimServer) DoControlMultiRequest(in *clustermessage.ClusterMessage) error
- func (s *ShimServer) DoControlRequest(in *clustermessage.ClusterMessage) (*clustermessage.ClusterMessage, error)
- func (s *ShimServer) RegisterHandler(name string, h handler.Handler)
- func (s *ShimServer) SendChan() chan clustermessage.ClusterMessage
- func (s *ShimServer) Serve(addr string) error
- type ShimServiceClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShimHandler ¶
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 (*ShimServer) ClusterName ¶
func (s *ShimServer) ClusterName() string
ClusterName returns the cluster name.
func (*ShimServer) Do ¶
func (s *ShimServer) Do(in *clustermessage.ClusterMessage) (*clustermessage.ClusterMessage, error)
Do handles the requests and transmits to corresponding server.
func (*ShimServer) DoControlMultiRequest ¶
func (s *ShimServer) DoControlMultiRequest(in *clustermessage.ClusterMessage) error
func (*ShimServer) DoControlRequest ¶
func (s *ShimServer) DoControlRequest(in *clustermessage.ClusterMessage) (*clustermessage.ClusterMessage, error)
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.