Documentation
¶
Overview ¶
Package roster is the party's list of channels: for each peer its local name (design §3.1: names are local), the channel id, the relay the channel lives on, this party's side and token, and how far the invite has gone. It is one record, key "peers", in the party's store, so every fleet host that holds the store can serve every channel. The peer's root key and card live on the channel record (store.Channel), not here.
Index ¶
Constants ¶
const Key = "peers"
Key is the roster record's key in the store.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Peer ¶
type Peer struct {
Name string `json:"name"`
Channel string `json:"channel"`
Relay string `json:"relay"`
Side Side `json:"side"`
Token string `json:"token"`
State State `json:"state"`
}
Peer is one channel as this party sees it.
type Roster ¶
type Roster struct {
Peers []Peer
// contains filtered or unexported fields
}
Roster is the record loaded at a version; Set changes it in memory and Commit writes it back under CAS.
func (*Roster) Commit ¶
Commit writes the roster as version Version()+1; another host's commit in between is store.ErrConflict and changes nothing.
type State ¶
type State string
State is how far the invite has gone.
const ( // Invited: the host created the channel and waits for the guest's card and the code. Invited State = "invited" // Accepted: the guest joined, built the session and sent its card; the host's confirm is pending. Accepted State = "accepted" // Confirmed: the host checked the session identity and the code and pinned the guest's card. Confirmed State = "confirmed" // Gone: the peer forgot the channel (its bye arrived). Nothing is sent or // pulled on it; the name stays taken until this party forgets it too. Gone State = "gone" )