Documentation ¶
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) Deregister(ctx context.Context, s *stela.Service) error
- func (c *Client) Discover(ctx context.Context, serviceName string) ([]*stela.Service, error)
- func (c *Client) DiscoverAll(ctx context.Context) ([]*stela.Service, error)
- func (c *Client) DiscoverOne(ctx context.Context, serviceName string) (*stela.Service, error)
- func (c *Client) DiscoverRegex(ctx context.Context, reg string) ([]*stela.Service, error)
- func (c *Client) Register(ctx context.Context, s *stela.Service) error
- func (c *Client) Subscribe(ctx context.Context, serviceName string, callback func(s *stela.Service)) error
- func (c *Client) Unsubscribe(ctx context.Context, serviceName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client struct represents a connection client connection to a stela instance
func NewClient ¶
NewClient returns a new Stela gRPC client for the given server address. The client's Close method should be called when the returned client is no longer needed.
func NewTLSClient ¶
func NewTLSClient(ctx context.Context, serverAddress string, serverName string, cert string, privateKey string, certificateAuthority string) (*Client, error)
NewTLSClient returns a new Stela gRPC client for the given server address. You must provide paths to a certificate authority, client certificate, and client private key. You must also provide a value for server name that matches the common name in the certificate of the server you are connecting to. The client's Close method should be called when the returned client is no longer needed.
func (*Client) Close ¶
func (c *Client) Close()
Close cancels the stream to the gRPC stream established by connect().
func (*Client) Deregister ¶
Deregister deregisters a service to the stela instance the client is connected to.
func (*Client) DiscoverAll ¶
DiscoverAll finds all services registered.
func (*Client) DiscoverOne ¶
DiscoverOne finds a single instance of a service based on name.
func (*Client) DiscoverRegex ¶
DiscoverRegex finds services by name based on a regular expression.
func (*Client) Register ¶
Register registers a service to the stela instance the client is connected to.