Documentation
¶
Overview ¶
Package grpc provides a gRPC client for the cluster sync service.
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) GetClusterStatus(ctx context.Context) (*clusterv1.ClusterStatusResponse, error)
- func (c *Client) GetEventsInRange(ctx context.Context, from, to uint64, limit int32) ([]*clusterv1.EventInfo, bool, uint64, error)
- func (c *Client) GetLatestSerial(ctx context.Context) (uint64, int64, error)
- func (c *Client) GetMemberStatus(ctx context.Context, httpURL string) (*clusterv1.MemberStatusResponse, error)
- func (c *Client) GetMembers(ctx context.Context) ([]*clusterv1.ClusterMember, error)
- func (c *Client) HandleEventsRange(ctx context.Context, method string, body []byte, headers map[string]string, ...) (int, []byte, map[string]string, error)
- func (c *Client) HandleLatestSerial(ctx context.Context, method string, body []byte, headers map[string]string) (int, []byte, map[string]string, error)
- func (c *Client) HandleMembershipEvent(ctx context.Context, event *commonv1.Event) error
- func (c *Client) Ready() <-chan struct{}
- func (c *Client) Start(ctx context.Context) error
- func (c *Client) Stop(ctx context.Context) error
- func (c *Client) UpdateMembership(ctx context.Context, relayURLs []string) error
- type ClientConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a gRPC client for the cluster sync service.
func New ¶
func New(ctx context.Context, cfg *ClientConfig) (*Client, error)
New creates a new gRPC cluster sync client.
func (*Client) GetClusterStatus ¶
GetClusterStatus returns overall cluster status.
func (*Client) GetEventsInRange ¶
func (c *Client) GetEventsInRange(ctx context.Context, from, to uint64, limit int32) ([]*clusterv1.EventInfo, bool, uint64, error)
GetEventsInRange returns event info for a serial range.
func (*Client) GetLatestSerial ¶
GetLatestSerial returns the latest serial from this relay's database.
func (*Client) GetMemberStatus ¶
func (c *Client) GetMemberStatus(ctx context.Context, httpURL string) (*clusterv1.MemberStatusResponse, error)
GetMemberStatus returns status for a specific member.
func (*Client) GetMembers ¶
GetMembers returns the current cluster members.
func (*Client) HandleEventsRange ¶
func (c *Client) HandleEventsRange(ctx context.Context, method string, body []byte, headers map[string]string, queryString string) (int, []byte, map[string]string, error)
HandleEventsRange proxies an HTTP events range request.
func (*Client) HandleLatestSerial ¶
func (c *Client) HandleLatestSerial(ctx context.Context, method string, body []byte, headers map[string]string) (int, []byte, map[string]string, error)
HandleLatestSerial proxies an HTTP latest serial request.
func (*Client) HandleMembershipEvent ¶
HandleMembershipEvent processes a cluster membership event.
func (*Client) Ready ¶
func (c *Client) Ready() <-chan struct{}
Ready returns a channel that closes when the client is ready.
func (*Client) Start ¶
Start starts the cluster polling loop.
func (*Client) Stop ¶
Stop stops the cluster polling loop.
Source Files
¶
- client.go