Documentation
¶
Overview ¶
Package seats reads the party's seat map — peers/seats.md on the fleet's sessions root (UCC design v2 § 5 § Address): one row per label, the agent id a sender addresses, naming where a message to it lands and the kinds the row accepts. UCC writes the map; peer reads it for its card and at the border of every delivery.
The grammar (K0, proposed by plan unit U11): the record's body holds one markdown table whose header names the columns label, to and accepts, in any order; other columns and the frontmatter are UCC's and are ignored.
| label | to | accepts | |--------|----------------------------------------------------------------------------|-------------------------------| | leader | [[projects/demo/rosters/leader-peer-v1]] | text task question answer ack | | zt | human [[projects/demo/rosters/advisor-demo]] | text question answer | | hook | service https://example.net/peer/hook | text |
The columns:
- label: an agent id, [A-Za-z0-9._-]{1,64}, unique in the map.
- to: a seat — [[<session>/rosters/<role>-<slug>]], the roster record's path under the root, so the seat's session is the part before /rosters/ — or human [[<session>/rosters/<role>-<slug>]], a person, whose messages are born in the session of the seat that relays to them (UCC's amendment; a bare human names no session and is refused), or service <url> with an https URL.
- accepts: one or more of the eight kinds — text task question answer doc file card ack — separated by spaces.
- rooms (optional, plan v2 decision 3): the rooms whose records with no agent in to land in this row's session — room names as this host names them, room ids, or * for every room — separated by spaces; empty or absent, none. A service row takes no rooms: a room record lands in a session.
A row outside the grammar makes the whole map invalid: nothing is delivered by a map that cannot be read, and nothing is consumed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMap = errors.New("seats: the map cannot be read")
ErrMap is a map outside the grammar.
var Kinds = []string{ session.KindText, session.KindTask, session.KindQuestion, session.KindAnswer, session.KindDoc, session.KindFile, session.KindCard, session.KindAck, }
Kinds is the vocabulary accepts draws from.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map is a parsed seat map.
func (*Map) Agents ¶
Agents is the map as the card's agent list, in the map's order: every row is an agent of the party with the row's accepts (design §3.3).
func (*Map) InRoom ¶ added in v0.2.0
InRoom is the rows, in the map's order, whose rooms column names the room — by this host's name for it, by its id, or by * — the rows a room record with no agent in to lands in.
func (*Map) LabelsAccepting ¶ added in v0.5.7
LabelsAccepting is the labels of the rows that accept kind, in the map's order — the labels a sender may address a kind message to.
func (*Map) LabelsOfSeat ¶ added in v0.5.8
LabelsOfSeat is the labels, in the map's order, of the seat and human rows whose to names the seat — the roster record's path under the root, a wikilink's text: the labels that seat answers for.
type Row ¶
type Row struct {
Label string
Kind Kind
// Seat rows, and human rows for the seat that relays to the person:
// Session is the session's path under the root, Seat the roster
// record's path under it (the wikilink's text).
Session, Seat string
// Service rows: the callback URL.
URL string
// Accepts is the row's subset of the eight kinds, in the row's order.
Accepts []string
// Rooms is the rooms column: room names, room ids or "*"; nil for none.
Rooms []string
}
Row is one label of the map.