Documentation
¶
Overview ¶
Package relayhttp is parley's reference relay: an HTTP Server that stores and forwards frames, and a Client that implements parley.Relay against it. Both live here so the wire format has exactly one owner. The relay holds no keys and reads no plaintext; a parley.Data frame's payload is ciphertext.
Index ¶
- type Client
- func (c *Client) Join(ctx context.Context, ch parley.ChannelID, present parley.JoinToken) (parley.Membership, error)
- func (c *Client) Members(ctx context.Context, m parley.Membership) (int, error)
- func (c *Client) Open(ctx context.Context, ch parley.ChannelID, expect parley.JoinToken) (parley.Membership, error)
- func (c *Client) Recv(ctx context.Context, m parley.Membership, after uint64, wait time.Duration) ([]parley.Frame, error)
- func (c *Client) Send(ctx context.Context, m parley.Membership, f parley.Frame) error
- type Server
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
}
A Client reaches a relay over HTTP. It implements parley.Relay.
func NewClient ¶
NewClient returns a client for the relay at base (e.g. "https://parley.chat").
func (*Client) Members ¶ added in v0.1.1
Members reports how many of the channel's two seats are occupied.
func (*Client) Recv ¶
func (c *Client) Recv(ctx context.Context, m parley.Membership, after uint64, wait time.Duration) ([]parley.Frame, error)
Recv polls once, waiting up to wait for at least one frame, and returns whatever is available (possibly nothing). Callers that want to block for a message loop over this themselves.