Sake.Protocol (Sake v0.1.0)

Copy Markdown View Source

The protocol revisions Sake speaks and the _meta keys the protocol reserves.

Revision 2026-07-28 is the modern era: stateless, one request at a time, the protocol version and the client capabilities in every request. The three earlier revisions are the legacy era with an initialize handshake and a session.

Summary

Functions

The legacy revision to serve a client that asked for requested: the requested one when Sake serves it, otherwise the newest legacy revision (the client then decides whether it can speak it).

Types

era()

@type era() :: :modern | :legacy

revision()

@type revision() :: String.t()

Functions

era(revision)

@spec era(revision()) :: era() | :unknown

legacy()

@spec legacy() :: [revision()]

meta(key)

@spec meta(atom()) :: String.t()

modern()

@spec modern() :: revision()

negotiate_legacy(requested)

@spec negotiate_legacy(term()) :: revision()

The legacy revision to serve a client that asked for requested: the requested one when Sake serves it, otherwise the newest legacy revision (the client then decides whether it can speak it).

supported()

@spec supported() :: [revision()]

supported?(revision)

@spec supported?(term()) :: boolean()