Help us shape the future of Go! Take the 2026 Go Developer Survey

pairings

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoomAdmitPath = "/v1/hub/admit"
	RoomLeavePath = "/v1/hub/leave"
)

Hub room requests a member makes to its room's home: redeeming a room invite (POST /v1/hub/admit) and leaving (POST /v1/hub/leave).

Variables

This section is empty.

Functions

func RoomControlPath added in v0.1.22

func RoomControlPath(globalRoomID string, afterSeq int64) string

RoomControlPath is GET /v1/hub/control with its query.

func RoomSyncPath added in v0.1.22

func RoomSyncPath(globalRoomID string, afterSeq, controlAfter int64) string

RoomSyncPath is GET /v1/hub/sync with its query.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func (*Client) FetchAgents

func (c *Client) FetchAgents(ctx context.Context, pairing protocol.Pairing) ([]protocol.AgentSummary, error)

func (*Client) FetchNetwork

func (c *Client) FetchNetwork(ctx context.Context, pairing protocol.Pairing) (protocol.Network, error)

func (*Client) FetchRoomControl added in v0.1.22

func (c *Client) FetchRoomControl(ctx context.Context, pairing protocol.Pairing, globalRoomID string, afterSeq int64) (protocol.RoomControlPage, error)

FetchRoomControl pulls a hub room's control log after afterSeq from the room's home, over the pairing that reaches it.

func (*Client) FetchRoomSync added in v0.1.22

func (c *Client) FetchRoomSync(ctx context.Context, pairing protocol.Pairing, globalRoomID string, afterSeq, controlAfter int64) (protocol.RoomSyncPage, error)

FetchRoomSync pulls a catch-up page of a hub room from its home.

func (*Client) FetchRooms

func (c *Client) FetchRooms(ctx context.Context, pairing protocol.Pairing) ([]protocol.Room, error)

func (*Client) RegisterRelay added in v0.1.14

func (c *Client) RegisterRelay(pairingID string, relayClient *relay.Client)

RegisterRelay associates a relay client with a configured pairing. Relay pairings require this registration before requests can be sent.

func (*Client) RelayMessage

func (c *Client) RelayMessage(
	ctx context.Context,
	pairing protocol.Pairing,
	requestPayload protocol.SendMessageRequest,
) (protocol.MessageAccepted, error)

func (*Client) RequestRoomAdmission added in v0.1.22

func (c *Client) RequestRoomAdmission(ctx context.Context, pairing protocol.Pairing, admission protocol.SignedRoomAdmission) (protocol.RoomControlPage, error)

RequestRoomAdmission redeems a room invite over its pairing.

func (*Client) RequestRoomLeave added in v0.1.22

func (c *Client) RequestRoomLeave(ctx context.Context, pairing protocol.Pairing, request protocol.RoomLeaveRequest) (protocol.RoomControlPage, error)

RequestRoomLeave asks the home to record this network leaving a room.

type ResponseError added in v0.1.21

type ResponseError struct {
	Code int
}

ResponseError preserves the peer's response status for delivery decisions. It deliberately excludes response bodies, which may contain private data.

func (*ResponseError) Error added in v0.1.21

func (e *ResponseError) Error() string

func (*ResponseError) StatusCode added in v0.1.21

func (e *ResponseError) StatusCode() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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