Versions in this module Expand all Collapse all v1 v1.0.1 Sep 9, 2024 v1.0.0 Sep 9, 2024 Changes in this version + const EventValidationTooLarge + const PublicKeyNotExpired + const PublicKeyNotValid + var ErrCanonicalJSON = errors.New("value is outside of safe range") + func Allowed(event PDU, authEvents AuthEventProvider, userIDQuerier spec.UserIDForSender) error + func CanonicalJSON(input []byte) ([]byte, error) + func CanonicalJSONAssumeValid(input []byte) []byte + func CheckFields(input PDU) error + func CheckStateResponse(ctx context.Context, r StateResponse, roomVersion RoomVersion, ...) ([]PDU, []PDU, error) + func CompactJSON(input, output []byte) []byte + func EnforcedCanonicalJSON(input []byte, roomVersion RoomVersion) ([]byte, error) + func KnownRoomVersion(verStr RoomVersion) bool + func NoStrictValidityCheck(_, _ spec.Timestamp) bool + func PerformJoin(ctx context.Context, fedClient FederatedJoinClient, input PerformJoinInput) (*PerformJoinResponse, *FederationError) + func RawJSONFromResult(result gjson.Result, _ []byte) []byte + func RoomVersions() map[RoomVersion]IRoomVersion + func SignJSON(signingName string, keyID KeyID, privateKey ed25519.PrivateKey, message []byte) (signed []byte, err error) + func SortJSON(input, output []byte) []byte + func SplitID(sigil byte, id string) (local string, domain spec.ServerName, err error) + func StableRoomVersion(verStr RoomVersion) bool + func StableRoomVersions() map[RoomVersion]IRoomVersion + func StrictValiditySignatureCheck(atTs, validUntil spec.Timestamp) bool + func VerifyAllEventSignatures(ctx context.Context, events []PDU, verifier JSONVerifier, ...) []error + func VerifyAuthRulesAtState(ctx context.Context, sp StateProvider, eventToVerify PDU, allowValidation bool, ...) error + func VerifyEventAuthChain(ctx context.Context, eventToVerify PDU, provideEvents EventProvider, ...) error + func VerifyEventSignatures(ctx context.Context, e PDU, verifier JSONVerifier, ...) error + func VerifyJSON(signingName string, keyID KeyID, publicKey ed25519.PublicKey, message []byte) error + type AuthChainErr struct + func (se AuthChainErr) Error() string + func (se AuthChainErr) Is(target error) bool + type AuthEventProvider interface + Create func() (PDU, error) + JoinRules func() (PDU, error) + Member func(stateKey spec.SenderID) (PDU, error) + PowerLevels func() (PDU, error) + ThirdPartyInvite func(stateKey string) (PDU, error) + Valid func() bool + type AuthEvents struct + func NewAuthEvents(events []PDU) AuthEvents + func (a *AuthEvents) AddEvent(event PDU) error + func (a *AuthEvents) Clear() + func (a *AuthEvents) Create() (PDU, error) + func (a *AuthEvents) JoinRules() (PDU, error) + func (a *AuthEvents) Member(stateKey spec.SenderID) (PDU, error) + func (a *AuthEvents) PowerLevels() (PDU, error) + func (a *AuthEvents) ThirdPartyInvite(stateKey string) (PDU, error) + func (a *AuthEvents) Valid() bool + type AuthRulesErr struct + func (se AuthRulesErr) Error() string + func (se AuthRulesErr) Is(target error) bool + type BackfillClient interface + Backfill func(ctx context.Context, origin, server spec.ServerName, roomID string, limit int, ...) (Transaction, error) + type BackfillRequester interface + ProvideEvents func(roomVer RoomVersion, eventIDs []string) ([]PDU, error) + ServersAtEvent func(ctx context.Context, roomID, eventID string) []spec.ServerName + type BadJSONError struct + func (e BadJSONError) Error() string + func (e BadJSONError) Unwrap() error + type CreateContent struct + Creator string + Federate *bool + Predecessor *PreviousRoom + RoomType string + RoomVersion *RoomVersion + func NewCreateContentFromAuthEvents(authEvents AuthEventProvider, userIDForSender spec.UserIDForSender) (c CreateContent, err error) + func (c *CreateContent) DomainAllowed(domain string) error + func (c *CreateContent) UserIDAllowed(id spec.UserID) error + type DeviceListUpdateEvent struct + Deleted bool + DeviceDisplayName string + DeviceID string + Keys json.RawMessage + PrevID []int64 + StreamID int64 + UserID string + type DirectKeyFetcher struct + Client KeyClient + IsLocalServerName func(server spec.ServerName) bool + LocalPublicKey spec.Base64Bytes + func (d *DirectKeyFetcher) FetchKeys(ctx context.Context, requests map[PublicKeyLookupRequest]spec.Timestamp) (map[PublicKeyLookupRequest]PublicKeyLookupResult, error) + func (d DirectKeyFetcher) FetcherName() string + type EDU struct + Content spec.RawJSON + Destination string + Origin string + Type string + func (e *EDU) CacheCost() int + type Ed25519Checks struct + MatchingSignature bool + ValidEd25519 bool + type EventBuilder struct + AuthEvents interface{} + Content spec.RawJSON + Depth int64 + PrevEvents interface{} + Redacts string + RoomID string + SenderID string + Signature spec.RawJSON + StateKey *string + Type string + Unsigned spec.RawJSON + func (eb *EventBuilder) AddAuthEvents(provider AuthEventProvider) error + func (eb *EventBuilder) Build(now time.Time, origin spec.ServerName, keyID KeyID, ...) (result PDU, err error) + func (eb *EventBuilder) SetContent(content interface{}) (err error) + func (eb *EventBuilder) SetUnsigned(unsigned interface{}) (err error) + type EventFormat int + const EventFormatV1 + const EventFormatV2 + type EventIDFormat int + const EventIDFormatV1 + const EventIDFormatV2 + const EventIDFormatV3 + type EventJSONs []spec.RawJSON + func NewEventJSONsFromEvents(he []PDU) EventJSONs + func (e EventJSONs) TrustedEvents(roomVersion RoomVersion, redacted bool) []PDU + func (e EventJSONs) UntrustedEvents(roomVersion RoomVersion) []PDU + type EventLoadResult struct + Error error + Event PDU + SoftFail bool + type EventProvider func(roomVer RoomVersion, eventIDs []string) ([]PDU, error) + type EventValidationError struct + Code int + Message string + Persistable bool + func (e EventValidationError) Error() string + type EventsLoader struct + func NewEventsLoader(roomVer RoomVersion, keyRing JSONVerifier, stateProvider StateProvider, ...) *EventsLoader + func (l *EventsLoader) LoadAndVerify(ctx context.Context, rawEvents []json.RawMessage, sortOrder TopologicalOrder, ...) ([]EventLoadResult, error) + type FederatedInviteClient interface + SendInvite func(ctx context.Context, event PDU, strippedState []InviteStrippedState) (PDU, error) + SendInviteV3 func(ctx context.Context, event ProtoEvent, userID spec.UserID, ...) (PDU, error) + type FederatedJoinClient interface + MakeJoin func(ctx context.Context, origin, s spec.ServerName, roomID, userID string) (res MakeJoinResponse, err error) + SendJoin func(ctx context.Context, origin, s spec.ServerName, event PDU) (res SendJoinResponse, err error) + type FederatedStateClient interface + LookupState func(ctx context.Context, origin, s spec.ServerName, roomID, eventID string, ...) (res StateResponse, err error) + LookupStateIDs func(ctx context.Context, origin, s spec.ServerName, roomID, eventID string) (res StateIDResponse, err error) + type FederatedStateProvider struct + AuthEventMap map[string]PDU + EventToAuthEventIDs map[string][]string + FedClient FederatedStateClient + Origin spec.ServerName + RememberAuthEvents bool + Server spec.ServerName + func (p *FederatedStateProvider) StateBeforeEvent(ctx context.Context, roomVer RoomVersion, event PDU, eventIDs []string) (map[string]PDU, error) + func (p *FederatedStateProvider) StateIDsBeforeEvent(ctx context.Context, event PDU) ([]string, error) + type FederationError struct + Err error + Reachable bool + ServerName spec.ServerName + Transient bool + func (e FederationError) Error() string + type FledglingEvent struct + Content interface{} + StateKey string + Type string + type GetLatestEvents func(ctx context.Context, roomID spec.RoomID, eventsNeeded []StateKeyTuple) (LatestEvents, error) + type HandleInviteInput struct + InviteEvent PDU + InvitedSenderID spec.SenderID + InvitedUser spec.UserID + KeyID KeyID + MembershipQuerier MembershipQuerier + PrivateKey ed25519.PrivateKey + RoomID spec.RoomID + RoomQuerier RoomQuerier + RoomVersion RoomVersion + StateQuerier StateQuerier + StrippedState []InviteStrippedState + UserIDQuerier spec.UserIDForSender + Verifier JSONVerifier + type HandleInviteV3Input struct + GetOrCreateSenderID spec.CreateSenderID + InviteProtoEvent ProtoEvent + type HandleMakeJoinInput struct + BuildEventTemplate func(*ProtoEvent) (PDU, []PDU, error) + Context context.Context + LocalServerInRoom bool + LocalServerName spec.ServerName + RemoteVersions []RoomVersion + RequestOrigin spec.ServerName + RoomID spec.RoomID + RoomQuerier RestrictedRoomJoinQuerier + RoomVersion RoomVersion + SenderID spec.SenderID + UserID spec.UserID + UserIDQuerier spec.UserIDForSender + type HandleMakeJoinResponse struct + JoinTemplateEvent ProtoEvent + RoomVersion RoomVersion + func HandleMakeJoin(input HandleMakeJoinInput) (*HandleMakeJoinResponse, error) + type HandleMakeLeaveInput struct + BuildEventTemplate func(*ProtoEvent) (PDU, []PDU, error) + LocalServerInRoom bool + LocalServerName spec.ServerName + RequestOrigin spec.ServerName + RoomID spec.RoomID + RoomVersion RoomVersion + SenderID spec.SenderID + UserID spec.UserID + UserIDQuerier spec.UserIDForSender + type HandleMakeLeaveResponse struct + LeaveTemplateEvent ProtoEvent + RoomVersion RoomVersion + func HandleMakeLeave(input HandleMakeLeaveInput) (*HandleMakeLeaveResponse, error) + type HandleSendJoinInput struct + Context context.Context + EventID string + JoinEvent spec.RawJSON + KeyID KeyID + LocalServerName spec.ServerName + MembershipQuerier MembershipQuerier + PrivateKey ed25519.PrivateKey + RequestOrigin spec.ServerName + RoomID spec.RoomID + RoomVersion RoomVersion + StoreSenderIDFromPublicID spec.StoreSenderIDFromPublicID + UserIDQuerier spec.UserIDForSender + Verifier JSONVerifier + type HandleSendJoinResponse struct + AlreadyJoined bool + JoinEvent PDU + func HandleSendJoin(input HandleSendJoinInput) (*HandleSendJoinResponse, error) + type HexString []byte + func (h *HexString) UnmarshalJSON(raw []byte) (err error) + func (h HexString) MarshalJSON() ([]byte, error) + type HistoryVisibility string + const HistoryVisibilityInvited + const HistoryVisibilityJoined + const HistoryVisibilityShared + const HistoryVisibilityWorldReadable + func (h *HistoryVisibility) Scan(src interface{}) error + func (h HistoryVisibility) Value() (driver.Value, error) + type HistoryVisibilityContent struct + HistoryVisibility HistoryVisibility + type IRoomVersion interface + CheckCanonicalJSON func(input []byte) error + CheckCreateEvent func(event PDU, knownRoomVersion knownRoomVersionFunc) error + CheckKnockingAllowed func(m *membershipAllower) error + CheckNotificationLevels func(senderLevel int64, oldPowerLevels, newPowerLevels PowerLevelContent) error + CheckRestrictedJoin func(ctx context.Context, localServerName spec.ServerName, ...) (string, error) + CheckRestrictedJoinsAllowed func() error + EventFormat func() EventFormat + EventIDFormat func() EventIDFormat + NewEventBuilder func() *EventBuilder + NewEventBuilderFromProtoEvent func(pe *ProtoEvent) *EventBuilder + NewEventFromTrustedJSON func(eventJSON []byte, redacted bool) (result PDU, err error) + NewEventFromTrustedJSONWithEventID func(eventID string, eventJSON []byte, redacted bool) (result PDU, err error) + NewEventFromUntrustedJSON func(eventJSON []byte) (result PDU, err error) + ParsePowerLevels func(contentBytes []byte, c *PowerLevelContent) error + RedactEventJSON func(eventJSON []byte) ([]byte, error) + RestrictedJoinServername func(content []byte) (spec.ServerName, error) + SignatureValidityCheck func(atTS, validUntil spec.Timestamp) bool + Stable func() bool + StateResAlgorithm func() StateResAlgorithm + Version func() RoomVersion + func GetRoomVersion(verStr RoomVersion) (impl IRoomVersion, err error) + func MustGetRoomVersion(verStr RoomVersion) IRoomVersion + type InviteStrippedState struct + func GenerateStrippedState(ctx context.Context, roomID spec.RoomID, stateQuerier StateQuerier) ([]InviteStrippedState, error) + func NewInviteStrippedState(event PDU) (ss InviteStrippedState) + func (i *InviteStrippedState) Content() spec.RawJSON + func (i *InviteStrippedState) Sender() string + func (i *InviteStrippedState) StateKey() *string + func (i *InviteStrippedState) Type() string + func (i *InviteStrippedState) UnmarshalJSON(data []byte) error + func (i InviteStrippedState) MarshalJSON() ([]byte, error) + type IsRejected func(eventID string) bool + type JSONVerifier interface + VerifyJSONs func(ctx context.Context, requests []VerifyJSONRequest) ([]VerifyJSONResult, error) + type JSONVerifierSelf struct + func (v JSONVerifierSelf) VerifyJSONs(ctx context.Context, requests []VerifyJSONRequest) ([]VerifyJSONResult, error) + type JoinRuleContent struct + Allow []JoinRuleContentAllowRule + JoinRule string + func NewJoinRuleContentFromAuthEvents(authEvents AuthEventProvider) (c JoinRuleContent, err error) + type JoinRuleContentAllowRule struct + RoomID string + Type string + type KeyChecks struct + AllChecksOK bool + AllEd25519ChecksOK *bool + Ed25519Checks map[KeyID]Ed25519Checks + FutureValidUntilTS bool + HasEd25519Key bool + MatchingServerName bool + func CheckKeys(serverName spec.ServerName, now time.Time, keys ServerKeys) (checks KeyChecks, ed25519Keys map[KeyID]spec.Base64Bytes) + type KeyClient interface + GetServerKeys func(ctx context.Context, matrixServer spec.ServerName) (ServerKeys, error) + LookupServerKeys func(ctx context.Context, matrixServer spec.ServerName, ...) ([]ServerKeys, error) + type KeyDatabase interface + StoreKeys func(ctx context.Context, results map[PublicKeyLookupRequest]PublicKeyLookupResult) error + type KeyFetcher interface + FetchKeys func(ctx context.Context, requests map[PublicKeyLookupRequest]spec.Timestamp) (map[PublicKeyLookupRequest]PublicKeyLookupResult, error) + FetcherName func() string + type KeyID string + func ListKeyIDs(signingName string, message []byte) ([]KeyID, error) + type KeyRing struct + KeyDatabase KeyDatabase + KeyFetchers []KeyFetcher + func (k KeyRing) VerifyJSONs(ctx context.Context, requests []VerifyJSONRequest) ([]VerifyJSONResult, error) + type LatestEvents struct + Depth int64 + PrevEventIDs []string + RoomExists bool + StateEvents []PDU + type MXIDMapping struct + Signatures map[spec.ServerName]map[KeyID]spec.Base64Bytes + UserID string + UserRoomKey spec.SenderID + func (m *MXIDMapping) Sign(serverName spec.ServerName, keyID KeyID, privateKey ed25519.PrivateKey) error + type MakeJoinResponse interface + GetJoinEvent func() ProtoEvent + GetRoomVersion func() RoomVersion + type MemberContent struct + AuthorisedVia string + AvatarURL string + DisplayName string + IsDirect bool + MXIDMapping *MXIDMapping + Membership string + Reason string + ThirdPartyInvite *MemberThirdPartyInvite + func NewMemberContentFromAuthEvents(authEvents AuthEventProvider, senderID spec.SenderID) (c MemberContent, err error) + func NewMemberContentFromEvent(event PDU) (c MemberContent, err error) + type MemberThirdPartyInvite struct + DisplayName string + Signed MemberThirdPartyInviteSigned + type MemberThirdPartyInviteSigned struct + MXID string + Signatures map[string]map[string]string + Token string + type MembershipQuerier interface + CurrentMembership func(ctx context.Context, roomID spec.RoomID, senderID spec.SenderID) (string, error) + type MissingAuthEventError struct + AuthEventID string + ForEventID string + func (e MissingAuthEventError) Error() string + type NotAllowed struct + Message string + func (a *NotAllowed) Error() string + type OldVerifyKey struct + ExpiredTS spec.Timestamp + type PDU interface + AuthEventIDs func() []string + Content func() []byte + Depth func() int64 + EventID func() string + HistoryVisibility func() (HistoryVisibility, error) + JSON func() []byte + JoinRule func() (string, error) + Membership func() (string, error) + OriginServerTS func() spec.Timestamp + PowerLevels func() (*PowerLevelContent, error) + PrevEventIDs func() []string + Redact func() + Redacted func() bool + Redacts func() string + RoomID func() spec.RoomID + SenderID func() spec.SenderID + SetUnsigned func(unsigned interface{}) (PDU, error) + SetUnsignedField func(path string, value interface{}) error + Sign func(signingName string, keyID KeyID, privateKey ed25519.PrivateKey) PDU + StateKey func() *string + StateKeyEquals func(s string) bool + ToHeaderedJSON func() ([]byte, error) + Type func() string + Unsigned func() []byte + Version func() RoomVersion + func HandleInvite(ctx context.Context, input HandleInviteInput) (PDU, error) + func HandleInviteV3(ctx context.Context, input HandleInviteV3Input) (PDU, error) + func HeaderedReverseTopologicalOrdering(events []PDU, order TopologicalOrder) []PDU + func LineariseStateResponse(roomVersion RoomVersion, r StateResponse) []PDU + func NewEventFromHeaderedJSON(headeredEventJSON []byte, redacted bool) (PDU, error) + func PerformInvite(ctx context.Context, input PerformInviteInput, fedClient FederatedInviteClient) (PDU, error) + func RequestBackfill(ctx context.Context, origin spec.ServerName, b BackfillRequester, ...) ([]PDU, error) + func ResolveConflicts(version RoomVersion, events []PDU, authEvents []PDU, ...) ([]PDU, error) + func ResolveStateConflicts(conflicted []PDU, authEvents []PDU, userIDForSender spec.UserIDForSender) []PDU + func ResolveStateConflictsV2(conflicted, unconflicted, authEvents []PDU, ...) []PDU + func ReverseTopologicalOrdering(input []PDU, order TopologicalOrder) []PDU + func ToPDUs[T PDU](events []T) []PDU + type PerformInviteInput struct + EventQuerier GetLatestEvents + EventTemplate ProtoEvent + EventTime time.Time + Invitee spec.UserID + Inviter spec.UserID + IsTargetLocal bool + KeyID KeyID + MembershipQuerier MembershipQuerier + RoomID spec.RoomID + RoomVersion RoomVersion + SenderIDCreator spec.CreateSenderID + SenderIDQuerier spec.SenderIDForUser + SigningKey ed25519.PrivateKey + StateQuerier StateQuerier + StoreSenderIDFromPublicID spec.StoreSenderIDFromPublicID + StrippedState []InviteStrippedState + UserIDQuerier spec.UserIDForSender + type PerformJoinInput struct + Content map[string]interface{} + EventProvider EventProvider + GetOrCreateSenderID spec.CreateSenderID + KeyID KeyID + KeyRing *KeyRing + PrivateKey ed25519.PrivateKey + RoomID *spec.RoomID + ServerName spec.ServerName + StoreSenderIDFromPublicID spec.StoreSenderIDFromPublicID + Unsigned map[string]interface{} + UserID *spec.UserID + UserIDQuerier spec.UserIDForSender + type PerformJoinResponse struct + JoinEvent PDU + StateSnapshot StateResponse + type PerspectiveKeyFetcher struct + Client KeyClient + PerspectiveServerKeys map[KeyID]ed25519.PublicKey + PerspectiveServerName spec.ServerName + func (p *PerspectiveKeyFetcher) FetchKeys(ctx context.Context, requests map[PublicKeyLookupRequest]spec.Timestamp) (map[PublicKeyLookupRequest]PublicKeyLookupResult, error) + func (p PerspectiveKeyFetcher) FetcherName() string + type PowerLevelContent struct + Ban int64 + Events map[string]int64 + EventsDefault int64 + Invite int64 + Kick int64 + Notifications map[string]int64 + Redact int64 + StateDefault int64 + Users map[string]int64 + UsersDefault int64 + func NewPowerLevelContentFromAuthEvents(authEvents AuthEventProvider, creatorUserID string) (c PowerLevelContent, err error) + func NewPowerLevelContentFromEvent(event PDU) (c PowerLevelContent, err error) + func (c *PowerLevelContent) Defaults() + func (c *PowerLevelContent) EventLevel(eventType string, isState bool) int64 + func (c *PowerLevelContent) NotificationLevel(notification string) int64 + func (c *PowerLevelContent) UserLevel(senderID spec.SenderID) int64 + type PreviousRoom struct + EventID string + RoomID string + type ProtoEvent struct + AuthEvents interface{} + Content spec.RawJSON + Depth int64 + PrevEvents interface{} + Redacts string + RoomID string + SenderID string + Signature spec.RawJSON + StateKey *string + Type string + Unsigned spec.RawJSON + func (pe *ProtoEvent) SetContent(content interface{}) (err error) + func (pe *ProtoEvent) SetUnsigned(unsigned interface{}) (err error) + type PublicKey struct + KeyValidityURL string + PublicKey spec.Base64Bytes + type PublicKeyLookupRequest struct + KeyID KeyID + ServerName spec.ServerName + func (r *PublicKeyLookupRequest) UnmarshalText(text []byte) error + func (r PublicKeyLookupRequest) MarshalText() ([]byte, error) + type PublicKeyLookupResult struct + ExpiredTS spec.Timestamp + ValidUntilTS spec.Timestamp + func (r PublicKeyLookupResult) WasValidAt(atTs spec.Timestamp, signatureValidityCheck SignatureValidityCheckFunc) bool + type PublicKeyNotaryLookupRequest struct + ServerKeys map[spec.ServerName]map[KeyID]PublicKeyNotaryQueryCriteria + type PublicKeyNotaryQueryCriteria struct + MinimumValidUntilTS spec.Timestamp + type RelatesTo struct + EventID string + RelationType string + type RelationContent struct + Relations *RelatesTo + type RestrictedRoomJoinInfo struct + JoinedUsers []PDU + LocalServerInRoom bool + UserJoinedToRoom bool + type RestrictedRoomJoinQuerier interface + CurrentStateEvent func(ctx context.Context, roomID spec.RoomID, eventType string, stateKey string) (PDU, error) + InvitePending func(ctx context.Context, roomID spec.RoomID, senderID spec.SenderID) (bool, error) + RestrictedRoomJoinInfo func(ctx context.Context, roomID spec.RoomID, senderID spec.SenderID, ...) (*RestrictedRoomJoinInfo, error) + type RoomQuerier interface + IsKnownRoom func(ctx context.Context, roomID spec.RoomID) (bool, error) + type RoomVersion string + const RoomVersionPseudoIDs + const RoomVersionV1 + const RoomVersionV10 + const RoomVersionV11 + const RoomVersionV2 + const RoomVersionV3 + const RoomVersionV4 + const RoomVersionV5 + const RoomVersionV6 + const RoomVersionV7 + const RoomVersionV8 + const RoomVersionV9 + type RoomVersionImpl struct + func (v RoomVersionImpl) CheckCanonicalJSON(eventJSON []byte) error + func (v RoomVersionImpl) CheckCreateEvent(event PDU, knownRoomVersion knownRoomVersionFunc) error + func (v RoomVersionImpl) CheckKnockingAllowed(m *membershipAllower) error + func (v RoomVersionImpl) CheckNotificationLevels(senderLevel int64, oldPowerLevels, newPowerLevels PowerLevelContent) error + func (v RoomVersionImpl) CheckRestrictedJoin(ctx context.Context, localServerName spec.ServerName, ...) (string, error) + func (v RoomVersionImpl) CheckRestrictedJoinsAllowed() error + func (v RoomVersionImpl) EventFormat() EventFormat + func (v RoomVersionImpl) EventIDFormat() EventIDFormat + func (v RoomVersionImpl) NewEventBuilder() *EventBuilder + func (v RoomVersionImpl) NewEventBuilderFromProtoEvent(pe *ProtoEvent) *EventBuilder + func (v RoomVersionImpl) NewEventFromTrustedJSON(eventJSON []byte, redacted bool) (result PDU, err error) + func (v RoomVersionImpl) NewEventFromTrustedJSONWithEventID(eventID string, eventJSON []byte, redacted bool) (result PDU, err error) + func (v RoomVersionImpl) NewEventFromUntrustedJSON(eventJSON []byte) (result PDU, err error) + func (v RoomVersionImpl) ParsePowerLevels(contentBytes []byte, c *PowerLevelContent) error + func (v RoomVersionImpl) RedactEventJSON(eventJSON []byte) ([]byte, error) + func (v RoomVersionImpl) RestrictedJoinServername(content []byte) (spec.ServerName, error) + func (v RoomVersionImpl) SignatureValidityCheck(atTS, validUntilTS spec.Timestamp) bool + func (v RoomVersionImpl) Stable() bool + func (v RoomVersionImpl) StateResAlgorithm() StateResAlgorithm + func (v RoomVersionImpl) Version() RoomVersion + type SendJoinResponse interface + GetAuthEvents func() EventJSONs + GetJoinEvent func() spec.RawJSON + GetMembersOmitted func() bool + GetOrigin func() spec.ServerName + GetServersInRoom func() []string + GetStateEvents func() EventJSONs + type SendToDeviceEvent struct + Content json.RawMessage + Sender string + Type string + type ServerKeyFields struct + OldVerifyKeys map[KeyID]OldVerifyKey + ServerName spec.ServerName + ValidUntilTS spec.Timestamp + VerifyKeys map[KeyID]VerifyKey + type ServerKeys struct + Raw []byte + func (keys *ServerKeys) UnmarshalJSON(data []byte) error + func (keys ServerKeys) MarshalJSON() ([]byte, error) + func (keys ServerKeys) PublicKey(keyID KeyID, atTS spec.Timestamp) []byte + type SignatureErr struct + func (se SignatureErr) Error() string + func (se SignatureErr) Is(target error) bool + type SignatureValidityCheckFunc func(atTS, validUntil spec.Timestamp) bool + type StateIDResponse interface + GetAuthEventIDs func() []string + GetStateEventIDs func() []string + type StateKeyTuple struct + EventType string + StateKey string + type StateNeeded struct + Create bool + JoinRules bool + Member []string + PowerLevels bool + ThirdPartyInvite []string + func StateNeededForAuth(events []PDU) (result StateNeeded) + func StateNeededForProtoEvent(protoEvent *ProtoEvent) (result StateNeeded, err error) + func (s StateNeeded) AuthEventReferences(provider AuthEventProvider) (refs []string, err error) + func (s StateNeeded) Tuples() (res []StateKeyTuple) + type StateProvider interface + StateBeforeEvent func(ctx context.Context, roomVer RoomVersion, event PDU, eventIDs []string) (map[string]PDU, error) + StateIDsBeforeEvent func(ctx context.Context, event PDU) ([]string, error) + type StateQuerier interface + GetAuthEvents func(ctx context.Context, event PDU) (AuthEventProvider, error) + GetState func(ctx context.Context, roomID spec.RoomID, stateWanted []StateKeyTuple) ([]PDU, error) + type StateResAlgorithm int + const StateResV1 + const StateResV2 + type StateResponse interface + GetAuthEvents func() EventJSONs + GetStateEvents func() EventJSONs + func CheckSendJoinResponse(ctx context.Context, roomVersion RoomVersion, r StateResponse, ...) (StateResponse, error) + type ThirdPartyInviteContent struct + DisplayName string + KeyValidityURL string + PublicKey string + PublicKeys []PublicKey + func NewThirdPartyInviteContentFromAuthEvents(authEvents AuthEventProvider, token string) (t ThirdPartyInviteContent, err error) + type ToDeviceMessage struct + MessageID string + Messages map[string]map[string]json.RawMessage + Sender string + Type string + type TopologicalOrder int + const TopologicalOrderByAuthEvents + const TopologicalOrderByPrevEvents + type Transaction struct + Destination spec.ServerName + EDUs []EDU + Origin spec.ServerName + OriginServerTS spec.Timestamp + PDUs []json.RawMessage + PreviousIDs []TransactionID + TransactionID TransactionID + type TransactionID string + type UnsupportedRoomVersionError struct + Version RoomVersion + func (e UnsupportedRoomVersionError) Error() string + type VerifyJSONRequest struct + AtTS spec.Timestamp + Message []byte + ServerName spec.ServerName + ValidityCheckingFunc SignatureValidityCheckFunc + type VerifyJSONResult struct + Error error + type VerifyKey struct + Key spec.Base64Bytes