Files
mesh-contracts/operator-and-conversation/go/clients/operatorchannelclient/bench.go
T

47 lines
1.8 KiB
Go

package operatorchannelclient
// The subjects and words of the two kinded benches a channel holds, `channel` (to show and say) and `intake` (to say
// what was chosen, and to ask a proof): the router and every channel share them (novox/hq ADR 0259 §3, ADR 0634 §1).
// The shapes carried are the seat's types (Message, Choice, LinkAsked, Failed, Standing, Code, ProofAnswer).
// The benches.
const (
// ChannelSeat is the kinded bench a channel holds to show and say: its accepts carry the kind.
ChannelSeat = "channel"
// IntakeSeat is the kinded bench a channel holds to say what was chosen: its events and proofs carry the kind.
IntakeSeat = "intake"
)
// The work a channel takes, on ChannelSubject.
const (
Show = "show" // a message offering answers
Edit = "edit" // a message shown before, replaced
Send = "send" // a message offering nothing
)
// ChannelSubject is where the router sends a channel of a kind its work.
func ChannelSubject(verb, kind string) string {
return "mesh.seat." + ChannelSeat + ".accept." + verb + "." + kind
}
// What a channel says, on IntakeSubject.
const (
Chosen = "choice" // a button tapped
Link = "link" // somebody asked to be linked as the operator
FailedWhat = "failed" // a message it could not deliver
StandingWhat = "standing" // what it says of itself
)
// IntakeSubject is where a channel of a kind says what arrived.
func IntakeSubject(what, kind string) string {
return "mesh.seat." + IntakeSeat + ".event." + what + "." + kind
}
// CodeProof is the one proof verb: a code the operator typed, carried by request and reply, never kept.
const CodeProof = "code"
// ProofSubject is where a channel of a kind asks a proof.
func ProofSubject(verb, kind string) string {
return "mesh.seat." + IntakeSeat + ".proof." + verb + "." + kind
}