relayhttp

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 15 Imported by: 0

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

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

func NewClient(base string) *Client

NewClient returns a client for the relay at base (e.g. "https://parley.chat").

func (*Client) Join

func (*Client) Members added in v0.1.1

func (c *Client) Members(ctx context.Context, m parley.Membership) (int, error)

Members reports how many of the channel's two seats are occupied.

func (*Client) Open

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.

func (*Client) Send

func (c *Client) Send(ctx context.Context, m parley.Membership, f parley.Frame) error

type Server

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

A Server is the relay's HTTP surface over an in-memory store. The zero value is not usable; construct it with NewServer.

func NewServer

func NewServer() *Server

NewServer returns an empty relay.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler mounts the relay's routes.

Jump to

Keyboard shortcuts

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