grpc

package
v0.55.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Unlicense Imports: 7 Imported by: 0

Documentation

Overview

Package grpc provides a gRPC client for the cluster sync service.

Index

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) Close

func (c *Client) Close() error

Close closes the gRPC connection.

func (*Client) GetClusterStatus

func (c *Client) GetClusterStatus(ctx context.Context) (*clusterv1.ClusterStatusResponse, error)

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

func (c *Client) GetLatestSerial(ctx context.Context) (uint64, int64, error)

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

func (c *Client) GetMembers(ctx context.Context) ([]*clusterv1.ClusterMember, error)

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

func (c *Client) HandleMembershipEvent(ctx context.Context, event *commonv1.Event) error

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

func (c *Client) Start(ctx context.Context) error

Start starts the cluster polling loop.

func (*Client) Stop

func (c *Client) Stop(ctx context.Context) error

Stop stops the cluster polling loop.

func (*Client) UpdateMembership

func (c *Client) UpdateMembership(ctx context.Context, relayURLs []string) error

UpdateMembership updates cluster membership.

type ClientConfig

type ClientConfig struct {
	ServerAddress  string
	ConnectTimeout time.Duration
}

ClientConfig holds configuration for the gRPC client.

Source Files

  • client.go

Jump to

Keyboard shortcuts

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