1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package docs
- // An EventReference is a reference to a matrix event.
- type EventReference struct {
- // The event ID of the event.
- EventID string
- // The sha256 of the redacted event.
- EventSHA256 Base64String
- }
- // A StateKeyTuple is the combination of an event type and an event state key.
- // It is often used as a key in maps.
- type StateKeyTuple struct {
- // The "type" key of a matrix event.
- EventType string
- // The "state_key" of a matrix event.
- // The empty string is a legitimate value for the "state_key" in matrix
- // so take care to initialise this field lest you accidentally request a
- // "state_key" with the go default of the empty string.
- StateKey string
- }
- // An Event is a matrix event.
- // The event should always contain valid JSON.
- // If the event content hash is invalid then the event is redacted.
- // Redacted events contain only the fields covered by the event signature.
- type Event struct {
- redacted bool
- eventJSON []byte
- fields eventFields
- }
- //Events
- // An EventBuilder is used to build a new event.
- // These can be exchanged between matrix servers in the federation APIs when
- // joining or leaving a room.
- type EventBuilder struct {
- // The user ID of the user sending the event.
- Sender string `json:"sender"`
- // The room ID of the room this event is in.
- RoomID string `json:"room_id"`
- // The type of the event.
- Type string `json:"type"`
- // The state_key of the event if the event is a state event or nil if the event is not a state event.
- StateKey *string `json:"state_key,omitempty"`
- // The events that immediately preceded this event in the room history.
- PrevEvents []EventReference `json:"prev_events"`
- // The events needed to authenticate this event.
- AuthEvents []EventReference `json:"auth_events"`
- // The event ID of the event being redacted if this event is a "m.room.redaction".
- Redacts string `json:"redacts,omitempty"`
- // The depth of the event, This should be one greater than the maximum depth of the previous events.
- // The create event has a depth of 1.
- Depth int64 `json:"depth"`
- // The JSON object for "content" key of the event.
- Content rawJSON `json:"content"`
- // The JSON object for the "unsigned" key
- Unsigned rawJSON `json:"unsigned,omitempty"`
- }
|