events

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package events is the event contract of a gawk deployment (R51, docs/52).

Every event gawk emits — on the R50 NATS bus and in a webhook — is a CloudEvents 1.0 event in the JSON structured format (D1), whose `data` is described by one JSON Schema 2020-12 file per event type (D2, `schema/`), listed in one AsyncAPI 3.0 catalogue (D3, `asyncapi.yaml`). This package holds the envelope type, the Go form of every `data` shape, the type constants, the one encoder, and the embedded schema files, so that the relay (the bus producer), gawk-admin (the webhook producer, projector and server of the documents) and any third module import one definition rather than restating it — the `wire` posture (CLAUDE.md: reuse, never mirror).

It is deliberately public, and deliberately small: no CloudEvents SDK, no validator, no protocol binding. Producers marshal typed structs; the tests in this package prove the structs match the schemas (D7), and the schemas are what a consumer codes against.

The rules a new event type has to follow are in docs/52 D6; the tests here enforce them. Adding a type means, in one PR: a `Type*` constant here, its Data struct in data.go, `schema/<type>.json`, `testdata/vectors/<type>.json` plus its fixture in fixtures_test.go, and a message in `asyncapi.yaml` — under the `webhook` channel too if it may reach a webhook. `go test` names whatever is missing.

Index

Constants

View Source
const (
	// EnforcementPending is the only enforcement value: present when the
	// Kubernetes object that would MAKE a moderation event true had not been
	// written when the event was recorded, absent when record and
	// enforcement agree (gawk-admin's store.EnforcementState).
	EnforcementPending = "pending"

	// Room kinds.
	RoomKindStatic  = "static"
	RoomKindDynamic = "dynamic"

	// Client kinds — the JSON spelling of wire.RoomClient*.
	ClientKindWebViewer      = "web-viewer"
	ClientKindWebBroadcaster = "web-broadcaster"
	ClientKindNative         = "native"

	// Broadcast roles — the R17 vocabulary /statusz uses.
	RoleOrigin = "origin"
	RoleEdge   = "edge"

	// Why a broadcast ended.
	BroadcastEndedGC       = "gc"
	BroadcastEndedKilled   = "killed"
	BroadcastEndedReplaced = "replaced"

	// Why a room closed.
	RoomClosedGrace    = "grace"
	RoomClosedCreator  = "creator"
	RoomClosedOperator = "operator"

	// Why a participant left. Only the first is somebody leaving: the other
	// three are the room happening TO them, and a consumer that announces
	// departures wants to tell them apart.
	ParticipantLeft = "left"
	// ParticipantLeftTimeout: the control session stopped keeping up and was
	// evicted (wire close 4001, non-terminal — a fresh session restores it).
	ParticipantLeftTimeout = "timeout"
	// ParticipantLeftRoomEnded: the room ended under them. It follows a
	// room.closed for the same room.
	ParticipantLeftRoomEnded = "room_ended"
	// ParticipantLeftHomeMoved: the room moved to another pod and they are
	// reconnecting there. It follows a room.home_changed published by the NEW
	// home, and the joins that follow carry rejoin: true — nobody left.
	ParticipantLeftHomeMoved = "home_moved"
)

Closed vocabularies. Consumers are told (asyncapi.yaml) to treat an unknown value as unknown, because a vocabulary may grow additively (D6 b).

View Source
const (
	// SpecVersion is the CloudEvents specification version.
	SpecVersion = "1.0"
	// ContentType is the media type of an event on the wire — the JSON
	// structured format — on both channels. It is the `Content-Type` of a
	// webhook delivery and the NATS `Content-Type` header.
	ContentType = "application/cloudevents+json"
	// DataContentType is the media type of `data`. Always JSON: `data` is a
	// JSON value inside the envelope, never a base64 blob.
	DataContentType = "application/json"

	// SourceAdmin is the `source` of every portal-originated event.
	SourceAdmin = "/gawk/admin"

	// TypePrefix is the reverse-DNS namespace every type starts with (D6 a).
	TypePrefix = "fi.ioio.gawk."

	// SchemaIDBase is the `$id` prefix of every data schema, and the prefix
	// of every event's `dataschema` (D2). It is an IDENTIFIER, not a promise
	// of a URL: the schema resolves in this package, in the repository at
	// the release tag, and on every gawk-admin deployment at
	// /api/v1/schemas/events/<type>.json. Making the literal URL resolve on
	// the project site is deferred (docs/52 §2, Rejected).
	SchemaIDBase = "https://gawk.ioio.fi/schemas/events/"
)

The CloudEvents attributes every event carries verbatim (D1).

View Source
const (
	// Moderation events: portal-originated, one per moderation_events row
	// (R39, R42). Their `source` is SourceAdmin and their `id` is a UUIDv5
	// over the row (docs/52 D1). ModerationType maps the row's short type to
	// these.
	TypeBroadcastKilled   = TypePrefix + "broadcast.killed"
	TypeBanCreated        = TypePrefix + "ban.created"
	TypeBanExpired        = TypePrefix + "ban.expired"
	TypeBanRemoved        = TypePrefix + "ban.removed"
	TypeContentFlagRaised = TypePrefix + "content_flag.raised" // reserved for R40, never produced yet
	TypeRoomCreated       = TypePrefix + "room.created"
	TypeRoomEnded         = TypePrefix + "room.ended"
	TypeRoomSecretRotated = TypePrefix + "room.secret_rotated"

	// Bus events: relay-published from the fan-out points docs/51 D3 names
	// (R50 wires the producers; the types and schemas are fixed here first).
	// Their `source` is SourceRelay(pod) and their `id` is BusID(pod, seq).
	//
	// The room lifecycle types are `opened` / `closed`, deliberately NOT
	// `created` / `ended`: those are the moderation row types above, and one
	// string meaning two payload shapes is the docs/51 D3 finding this
	// package exists to prevent (D6 e).
	TypeBroadcastStarted       = TypePrefix + "broadcast.started"
	TypeBroadcastPublisherAway = TypePrefix + "broadcast.publisher_away"
	TypeBroadcastPublisherBack = TypePrefix + "broadcast.publisher_back"
	TypeBroadcastEnded         = TypePrefix + "broadcast.ended"
	TypeBroadcastViewers       = TypePrefix + "broadcast.viewers"
	TypeRoomOpened             = TypePrefix + "room.opened"
	TypeRoomClosed             = TypePrefix + "room.closed"
	TypeRoomAttached           = TypePrefix + "room.attached"
	TypeRoomDetached           = TypePrefix + "room.detached"
	TypeRoomAttachmentUpdated  = TypePrefix + "room.attachment_updated"
	TypeRoomHomeChanged        = TypePrefix + "room.home_changed"
	TypeRoomParticipantJoined  = TypePrefix + "room.participant_joined"
	TypeRoomParticipantLeft    = TypePrefix + "room.participant_left"
	TypeRoomParticipantUpdated = TypePrefix + "room.participant_updated"

	// TypeWebhookTest is the synthetic event POST /webhooks/{name}/test
	// sends (docs/52 D5). Webhook-only: it is never on the bus and never a
	// stored row, because a test send is not a moderation action.
	TypeWebhookTest = TypePrefix + "webhook.test"
)

Event types. `fi.ioio.gawk.<scope>.<event>`; the NATS subject's last token is `<event>` (D6 a). One constant per schema file, per vector and per AsyncAPI message — the D7 tests hold the four sets equal.

A type is never versioned until a `v2` exists (docs/52 §2, Rejected): additive change keeps the type, an incompatible change is a new `….v2` type beside the deprecated old one.

View Source
const CommonSchemaFile = "common.json"

CommonSchemaFile is the shared-definitions file every data schema `$ref`s.

View Source
const SchemaDir = "schema"

SchemaDir is the directory inside Schemas.

View Source
const VectorDir = "testdata/vectors"

VectorDir is the directory inside Vectors.

Variables

View Source
var AsyncAPI []byte

AsyncAPI is the catalogue: every channel, every message, and the rules a consumer reads (D3). gawk-admin serves it bundled at /api/v1/asyncapi.json.

View Source
var CloudEventsSchema []byte

CloudEventsSchema is the CloudEvents project's own JSON Schema for the JSON format's envelope (cloudevents/spec, `cloudevents/formats/cloudevents.json` at commit 7bd28f7, 2021-11-04, Apache-2.0), vendored so the D7 tests can say "this is a CloudEvent" rather than "this looks like one". Not used by any production path.

View Source
var Schemas embed.FS

Schemas holds every data schema (`schema/<type>.json`) and the shared definitions they `$ref` (`schema/common.json`). gawk-admin serves them; the D7 tests validate every vector against them.

View Source
var Vectors embed.FS

Vectors holds the golden vectors (`testdata/vectors/<type>.json`): one fully-populated example event per type, with fictional identifiers. They are the examples a consumer can test a parser against, and what gawk-admin's D7 tests project and validate; the tests in this package hold each one byte-identical to its Go fixture.

Functions

func BusID

func BusID(pod string, seq uint64) string

BusID is the `id` of a relay-published event: `<pod>:<seq>` (docs/51 D3), the JetStream dedup key and gawk-admin's forever dedup key. A per-pod monotonic seq needs no coordination; the random start offset docs/51 requires is the producer's job, not this function's.

func IsType

func IsType(t string) bool

IsType reports whether t is a type this contract defines.

func Marshal

func Marshal(ev Event) ([]byte, error)

Marshal renders an event to the exact bytes that go on the wire — and, for a webhook, the exact bytes that are signed.

It is the one encoder. HTML escaping is off: `summary`, `reason`, `nickname` and `label` are human text that ends up in a push notification or a dashboard, and a consumer forwarding a field verbatim should show "spam & abuse" rather than the default encoder's "spam & abuse". The encoder's trailing newline is stripped so the signed material is the JSON value itself. Time is normalised to UTC so two producers render one instant one way.

func ModerationRowTypes

func ModerationRowTypes() []string

ModerationRowTypes returns every row type ModerationType knows, sorted.

func ModerationType

func ModerationType(rowType string) (string, bool)

ModerationType maps a moderation_events row type to its CloudEvents type. ok is false for a row type this contract does not know, which a producer must treat as a bug rather than invent a type for.

func Name

func Name(t string) string

Name returns the `<event>` segment of a type — the NATS subject's last token (D6 a) — or "" when t is not shaped like one of ours. A versioned type keeps its suffix: `participant_joined.v2`.

func Schema

func Schema(t string) ([]byte, error)

Schema returns the data schema of a type, or an error for a type that has none — which for a type in Types() is a broken build the D7 tests catch.

func SchemaByFile

func SchemaByFile(name string) (data []byte, ok bool)

SchemaByFile returns an embedded schema by its file name (`<type>.json` or CommonSchemaFile). ok is false for a name that is not a schema — the answer gawk-admin's serving route turns into a 404.

func SchemaFile

func SchemaFile(t string) string

SchemaFile is the file name of a type's data schema inside Schemas and the last path segment of its `$id` and of gawk-admin's serving route.

func SchemaFiles

func SchemaFiles() ([]string, error)

SchemaFiles lists every embedded schema file name, sorted.

func SchemaID

func SchemaID(t string) string

SchemaID is the `$id` of a type's data schema and the `dataschema` of every event of that type (D2).

func Scope

func Scope(t string) string

Scope returns the `<scope>` segment of a type (`broadcast`, `room`, …), or "" when t is not shaped like one of ours.

func SensitiveProperties

func SensitiveProperties(t string) ([]string, error)

SensitiveProperties returns the `data` property names a type's schema marks `x-gawk-sensitive: true`: the ones that carry a raw broadcast ID or a room code.

Since D9 the mark is a WARNING, not a filter. Both channels carry these properties — a webhook delivery is no longer projected free of them — and the mark is what tells a consumer, in the document it codes against, that the value is a joinable secret and that a delivery of this event must go somewhere its readers are allowed to join. The marks are read from the schema file rather than a Go list so that the document and the code cannot disagree about which properties those are.

func SourceRelay

func SourceRelay(pod string) string

SourceRelay is the `source` of an event published by the named relay pod.

func Types

func Types() []string

Types returns every event type this contract defines, in catalogue order.

A function returning a fresh slice rather than an exported slice variable: a package-level slice is writable by any importer, and this list is what the D7 tests hold the schema files, the vectors and the catalogue to.

func Vector

func Vector(t string) ([]byte, error)

Vector returns the golden vector of a type.

Types

type BanCreatedData

type BanCreatedData struct {
	Actor        string `json:"actor"`
	BroadcastKey string `json:"broadcastKey,omitempty"`
	BroadcastID  string `json:"broadcastId,omitempty"`
	Reason       string `json:"reason,omitempty"`
	Enforcement  string `json:"enforcement,omitempty"`
	Delivery
}

BanCreatedData is `fi.ioio.gawk.ban.created`. A ban on a publisher IP has no broadcast identity at all; the IP is never in any event.

type BanExpiredData

type BanExpiredData struct {
	Actor        string `json:"actor"`
	BroadcastKey string `json:"broadcastKey,omitempty"`
	BroadcastID  string `json:"broadcastId,omitempty"`
	Reason       string `json:"reason,omitempty"`
	Enforcement  string `json:"enforcement,omitempty"`
	Delivery
}

BanExpiredData is `fi.ioio.gawk.ban.expired`.

type BanRemovedData

type BanRemovedData struct {
	Actor        string `json:"actor"`
	BroadcastKey string `json:"broadcastKey,omitempty"`
	BroadcastID  string `json:"broadcastId,omitempty"`
	Reason       string `json:"reason,omitempty"`
	Enforcement  string `json:"enforcement,omitempty"`
	Delivery
}

BanRemovedData is `fi.ioio.gawk.ban.removed`.

type BroadcastEndedData

type BroadcastEndedData struct {
	BroadcastID  string `json:"broadcastId,omitempty"`
	BroadcastKey string `json:"broadcastKey"`
	// Reason is BroadcastEndedGC, BroadcastEndedKilled or
	// BroadcastEndedReplaced.
	Reason string `json:"reason"`
	Delivery
}

BroadcastEndedData is `fi.ioio.gawk.broadcast.ended`.

type BroadcastKilledData

type BroadcastKilledData struct {
	// Actor is who did it: an operator's identity, or `system`.
	Actor string `json:"actor"`
	// BroadcastKey is the HMAC'd key of the broadcast.
	BroadcastKey string `json:"broadcastKey,omitempty"`
	// BroadcastID is the raw, joinable ID. Sensitive (D9): delivered.
	BroadcastID string `json:"broadcastId,omitempty"`
	// Reason is the operator's free text.
	Reason string `json:"reason,omitempty"`
	// Enforcement is EnforcementPending or absent.
	Enforcement string `json:"enforcement,omitempty"`
	Delivery
}

BroadcastKilledData is `fi.ioio.gawk.broadcast.killed`.

type BroadcastPublisherAwayData

type BroadcastPublisherAwayData struct {
	BroadcastID  string `json:"broadcastId,omitempty"`
	BroadcastKey string `json:"broadcastKey"`
	Delivery
}

BroadcastPublisherAwayData is `fi.ioio.gawk.broadcast.publisher_away`: the publisher stalled and viewers are being held on the keepalive.

type BroadcastPublisherBackData

type BroadcastPublisherBackData struct {
	BroadcastID  string `json:"broadcastId,omitempty"`
	BroadcastKey string `json:"broadcastKey"`
	Delivery
}

BroadcastPublisherBackData is `fi.ioio.gawk.broadcast.publisher_back`.

type BroadcastStartedData

type BroadcastStartedData struct {
	BroadcastID  string `json:"broadcastId,omitempty"`
	BroadcastKey string `json:"broadcastKey"`
	// Role is RoleOrigin or RoleEdge — which side of the R17 cascade this
	// pod plays for the broadcast.
	Role string `json:"role"`
	// StartedAt is RFC 3339 UTC.
	StartedAt string `json:"startedAt"`
	Delivery
}

BroadcastStartedData is `fi.ioio.gawk.broadcast.started`.

type BroadcastViewersData

type BroadcastViewersData struct {
	BroadcastID   string `json:"broadcastId,omitempty"`
	BroadcastKey  string `json:"broadcastKey"`
	Role          string `json:"role"`
	ViewersLocal  int    `json:"viewersLocal"`
	ViewersGlobal int    `json:"viewersGlobal"`
	Delivery
}

BroadcastViewersData is `fi.ioio.gawk.broadcast.viewers`, coalesced to at most one per broadcast per interval and only on change. Published by both roles: the origin knows the global count, each edge its own local one.

type ContentFlagRaisedData

type ContentFlagRaisedData struct {
	Actor        string `json:"actor"`
	BroadcastKey string `json:"broadcastKey,omitempty"`
	BroadcastID  string `json:"broadcastId,omitempty"`
	Reason       string `json:"reason,omitempty"`
	Delivery
}

ContentFlagRaisedData is `fi.ioio.gawk.content_flag.raised` — reserved for R40 (docs/42 §4.11), fixed here so the vocabulary exists before anything produces it.

type Delivery

type Delivery struct {
	// Summary is the one human sentence docs/42 §4.10 promises every
	// receiver, so a webhook-to-push bridge (ntfy) needs no templating.
	Summary string `json:"summary,omitempty"`
	// PortalURL is the deep link into the portal — filtered by the HMAC'd
	// key, because that is what the portal's own routes take. It carries no
	// capability either way: acting requires logging in.
	PortalURL string `json:"portalUrl,omitempty"`
}

Delivery holds the two delivery-added properties every data schema declares optional (D4): a producer leaves them empty; gawk-admin fills them when it posts a webhook.

type Event

type Event struct {
	SpecVersion string `json:"specversion"`
	// ID is unique per Source: BusID on the bus, a UUIDv5 over the row for
	// a portal-originated event, a fresh UUID for a test send. A re-sent
	// duplicate — a webhook retry — carries the SAME id, which is what makes
	// it a receiver's idempotency key.
	ID     string `json:"id"`
	Source string `json:"source"`
	Type   string `json:"type"`
	// Subject is the raw broadcast ID or room code the event is about, in
	// cleartext, and absent for an event that is about neither (D9). It is
	// what a consumer routes and renders on — the string a person typed to
	// join — while the HMAC'd key stays in `data` beside it for the portal
	// links that are keyed by it. The NATS subject's key token is still the
	// HMAC'd one: that string shows up in bus monitoring, which is not the
	// event.
	Subject string `json:"subject,omitempty"`
	// Time is when the occurrence happened. Marshal renders it in UTC.
	Time            time.Time `json:"time"`
	DataContentType string    `json:"datacontenttype"`
	DataSchema      string    `json:"dataschema"`
	// Data is the typed payload: one of the structs in data.go, or — after
	// gawk-admin's webhook projection — a map of the surviving properties.
	Data any `json:"data"`
}

Event is the CloudEvents 1.0 envelope (D1), in the attribute order the JSON format's examples use. It has no extension attributes, on purpose: an extension is a forever commitment; anything an event has to say belongs in Data, under a schema.

func New

func New(typ, id, source, subject string, at time.Time, data any) Event

New fills the attributes that follow from the type — specversion, datacontenttype, dataschema — around the ones the producer supplies.

type RoomAttachedData

type RoomAttachedData struct {
	RoomCode     string `json:"roomCode,omitempty"`
	RoomKey      string `json:"roomKey"`
	DisplayCode  string `json:"displayCode,omitempty"`
	BroadcastID  string `json:"broadcastId,omitempty"`
	BroadcastKey string `json:"broadcastKey"`
	// Label is the tile's free text.
	Label string `json:"label,omitempty"`
	Delivery
}

RoomAttachedData is `fi.ioio.gawk.room.attached`: a broadcast joined a room's tiles.

type RoomAttachmentUpdatedData

type RoomAttachmentUpdatedData struct {
	RoomCode     string `json:"roomCode,omitempty"`
	RoomKey      string `json:"roomKey"`
	DisplayCode  string `json:"displayCode,omitempty"`
	BroadcastID  string `json:"broadcastId,omitempty"`
	BroadcastKey string `json:"broadcastKey"`
	Live         bool   `json:"live"`
	Viewers      int    `json:"viewers"`
	Delivery
}

RoomAttachmentUpdatedData is `fi.ioio.gawk.room.attachment_updated`, coalesced like BroadcastViewersData.

type RoomClosedData

type RoomClosedData struct {
	RoomCode    string `json:"roomCode,omitempty"`
	RoomKey     string `json:"roomKey"`
	DisplayCode string `json:"displayCode,omitempty"`
	// Kind is RoomKindStatic or RoomKindDynamic, as room.opened carries it.
	// gawk-admin's room.ended row has always named the kind, and the sentence
	// it renders says it ("a dynamic room ended"), so an end that did not
	// carry it would read worse than the poll it replaced.
	Kind string `json:"kind,omitempty"`
	// Reason is RoomClosedGrace, RoomClosedCreator or RoomClosedOperator.
	Reason string `json:"reason"`
	Delivery
}

RoomClosedData is `fi.ioio.gawk.room.closed`.

type RoomCreatedData

type RoomCreatedData struct {
	Actor string `json:"actor"`
	// RoomKey is the fleet's HMAC'd handle for the room (docs/44 D16).
	// Absent until a pod has homed the room.
	RoomKey string `json:"roomKey,omitempty"`
	// RoomCode is the joinable code. Sensitive (D9): delivered.
	RoomCode string `json:"roomCode,omitempty"`
	// DisplayCode is the code as shown to people: a static room's slug with
	// its configured casing, a dynamic room's code in upper case. Sensitive:
	// joinable, exactly like RoomCode, whose normalisation it undoes.
	DisplayCode string `json:"displayCode,omitempty"`
	// Kind is RoomKindStatic or RoomKindDynamic.
	Kind string `json:"kind,omitempty"`
	Delivery
}

RoomCreatedData is `fi.ioio.gawk.room.created`: an operator created a static room in the portal.

type RoomDetachedData

type RoomDetachedData struct {
	RoomCode     string `json:"roomCode,omitempty"`
	RoomKey      string `json:"roomKey"`
	DisplayCode  string `json:"displayCode,omitempty"`
	BroadcastID  string `json:"broadcastId,omitempty"`
	BroadcastKey string `json:"broadcastKey"`
	Label        string `json:"label,omitempty"`
	Delivery
}

RoomDetachedData is `fi.ioio.gawk.room.detached`.

type RoomEndedData

type RoomEndedData struct {
	Actor       string `json:"actor"`
	RoomKey     string `json:"roomKey,omitempty"`
	RoomCode    string `json:"roomCode,omitempty"`
	DisplayCode string `json:"displayCode,omitempty"`
	Kind        string `json:"kind,omitempty"`
	Reason      string `json:"reason,omitempty"`
	Delivery
}

RoomEndedData is `fi.ioio.gawk.room.ended`: a room ended, by an operator (Actor is their identity) or by the relay on its own (Actor `system`, and Reason says why once R50's bus feeds this row).

type RoomHomeChangedData

type RoomHomeChangedData struct {
	RoomCode    string `json:"roomCode,omitempty"`
	RoomKey     string `json:"roomKey"`
	DisplayCode string `json:"displayCode,omitempty"`
	Kind        string `json:"kind,omitempty"`
	// PreviousPod is the pod that held the home lease before this one, as the
	// Room CR recorded it. Absent when the lease was already released or the
	// record is gone.
	PreviousPod string `json:"previousPod,omitempty"`
	Delivery
}

RoomHomeChangedData is `fi.ioio.gawk.room.home_changed`: this pod adopted a room that another pod was serving (docs/44 §4.5's re-home).

It is published by the NEW home, so the CloudEvent's `source` names it — and that is deliberately the only place the new pod's name appears, because a second copy in `data` could disagree with it. PreviousPod names the other end when the CR still records it.

The new home is the one publisher that can be relied on here: a pod that loses a room because it is being deleted may publish nothing at all, so a consumer tracking where a room lives should follow this event rather than the departures on the old side.

type RoomOpenedData

type RoomOpenedData struct {
	RoomCode    string `json:"roomCode,omitempty"`
	RoomKey     string `json:"roomKey"`
	DisplayCode string `json:"displayCode,omitempty"`
	Kind        string `json:"kind"`
	CreatedAt   string `json:"createdAt"`
	Delivery
}

RoomOpenedData is `fi.ioio.gawk.room.opened`: the home pod took a room live — a dynamic room's birth, or a static room's first attach.

type RoomParticipantJoinedData

type RoomParticipantJoinedData struct {
	RoomCode    string `json:"roomCode,omitempty"`
	RoomKey     string `json:"roomKey"`
	DisplayCode string `json:"displayCode,omitempty"`
	// ParticipantID is the room-scoped id the roster uses (wire
	// Participant.id). Not a join capability.
	ParticipantID int    `json:"participantId"`
	Nickname      string `json:"nickname,omitempty"`
	ClientKind    string `json:"clientKind"`
	Streaming     bool   `json:"streaming"`
	Speaking      bool   `json:"speaking"`
	// Rejoin is true when the same participant resumed within the rejoin
	// window rather than arriving fresh (docs/50 D6's filter token).
	Rejoin bool `json:"rejoin"`
	Delivery
}

RoomParticipantJoinedData is `fi.ioio.gawk.room.participant_joined`.

type RoomParticipantLeftData

type RoomParticipantLeftData struct {
	RoomCode      string `json:"roomCode,omitempty"`
	RoomKey       string `json:"roomKey"`
	DisplayCode   string `json:"displayCode,omitempty"`
	ParticipantID int    `json:"participantId"`
	Nickname      string `json:"nickname,omitempty"`
	ClientKind    string `json:"clientKind"`
	// Reason is one of the ParticipantLeft* values. Absent means the plain
	// one: treat an unknown value as unknown, and an absent one as `left`.
	//
	// It exists because three of the four are not departures at all — the
	// room ended, the room moved, the session was evicted — and a consumer
	// that announced "tuhis left" for a pod rollout would be lying.
	Reason string `json:"reason,omitempty"`
	Delivery
}

RoomParticipantLeftData is `fi.ioio.gawk.room.participant_left`.

type RoomParticipantUpdatedData

type RoomParticipantUpdatedData struct {
	RoomCode      string `json:"roomCode,omitempty"`
	RoomKey       string `json:"roomKey"`
	DisplayCode   string `json:"displayCode,omitempty"`
	ParticipantID int    `json:"participantId"`
	Nickname      string `json:"nickname,omitempty"`
	ClientKind    string `json:"clientKind"`
	Streaming     bool   `json:"streaming"`
	Speaking      bool   `json:"speaking"`
	Delivery
}

RoomParticipantUpdatedData is `fi.ioio.gawk.room.participant_updated`: a nickname, streaming or speaking change.

type RoomSecretRotatedData

type RoomSecretRotatedData struct {
	Actor       string `json:"actor"`
	RoomKey     string `json:"roomKey,omitempty"`
	RoomCode    string `json:"roomCode,omitempty"`
	DisplayCode string `json:"displayCode,omitempty"`
	Kind        string `json:"kind,omitempty"`
	Delivery
}

RoomSecretRotatedData is `fi.ioio.gawk.room.secret_rotated`.

type WebhookTestData

type WebhookTestData struct {
	Delivery
}

WebhookTestData is `fi.ioio.gawk.webhook.test`: nothing but the two delivery properties, because a test has nothing to say about any broadcast and must not invent any.

Jump to

Keyboard shortcuts

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