Documentation
¶
Overview ¶
Package master holds the code for a master in the robot system. The master is the main coordination point, all other service are discovered through the master. It's main job is to manage and control the set of satellites. A satellite is a server that offers any of the other robot services.
Index ¶
- func Serve(ctx context.Context, grpcServer *grpc.Server, m Master) error
- type Client
- func (c *Client) Kill(ctx context.Context, to ...string) error
- func (c *Client) Orbit(ctx context.Context, services ServiceList) (Shutdown, error)
- func (c *Client) Restart(ctx context.Context, to ...string) error
- func (c *Client) Search(ctx context.Context, query *search.Query, handler SatelliteHandler) error
- func (c *Client) Shutdown(ctx context.Context, to ...string) error
- type CommandHandler
- type Master
- type SatelliteHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { // Master is the master this client is talking to. // This should not be modifed, the results are undefined if you do. Master Master // contains filtered or unexported fields }
Client is a wrapper over a Master object that provides client targeted features.
func (*Client) Orbit ¶
Orbit registers a satellite with the master. The function will only return when the connection is lost.
type CommandHandler ¶
type Master ¶
type Master interface { // Search returns a iterator of matching satellites from the store. Search(context.Context, *search.Query, SatelliteHandler) error // Orbit adds a satellite to the set being managed by the master. // The master will use the returned command stream to control the satellite. Orbit(context.Context, ServiceList, CommandHandler) error // Shutdown is called to ask the master to send shutdown requests to satellites. Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error) }
Master is the interface to a master implementation. It abstracts away whether the master is remote or local.
func NewRemoteMaster ¶
func NewRemoteMaster(ctx context.Context, conn *grpc.ClientConn) Master
NewRemoteMaster returns a Master that talks to a remote grpc Master service.