grpc

package
v0.58.2 Latest Latest
Warning

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

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

Documentation

Overview

Package grpc provides a gRPC client for the relay group 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 relay group service.

func New

func New(ctx context.Context, cfg *ClientConfig) (*Client, error)

New creates a new gRPC relay group client.

func (*Client) Close

func (c *Client) Close() error

Close closes the gRPC connection.

func (*Client) FindAuthoritativeConfig

func (c *Client) FindAuthoritativeConfig(ctx context.Context) (*relaygroupv1.RelayGroupConfigResponse, error)

FindAuthoritativeConfig finds the authoritative relay group configuration.

func (*Client) GetAuthorizedPubkeys

func (c *Client) GetAuthorizedPubkeys(ctx context.Context) ([][]byte, error)

GetAuthorizedPubkeys returns all authorized publisher pubkeys.

func (*Client) GetRelays

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

GetRelays returns the list of relays from the authoritative config.

func (*Client) HandleRelayGroupEvent

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

HandleRelayGroupEvent processes a relay group event and triggers peer updates.

func (*Client) IsAuthorizedPublisher

func (c *Client) IsAuthorizedPublisher(ctx context.Context, pubkey []byte) (bool, error)

IsAuthorizedPublisher checks if a pubkey can publish relay group configs.

func (*Client) Ready

func (c *Client) Ready() <-chan struct{}

Ready returns a channel that closes when the client is ready.

func (*Client) ValidateRelayGroupEvent

func (c *Client) ValidateRelayGroupEvent(ctx context.Context, event *commonv1.Event) (bool, string, error)

ValidateRelayGroupEvent validates a relay group configuration event.

type ClientConfig

type ClientConfig struct {
	ServerAddress  string
	ConnectTimeout time.Duration
}

ClientConfig holds configuration for the gRPC client.

Jump to

Keyboard shortcuts

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