Versions in this module Expand all Collapse all v1 v1.1.0 Apr 2, 2023 Changes in this version type Event + func (e *Event) RootRoomAuthEventIDs() []string + func (e *Event) RootRoomAuthEvents() []EventReference + func (e *Event) RootRoomID() *string type EventBuilder + RootRoomAuthEvents interface{} + RootRoomId *string v1.0.1 Apr 28, 2022 Changes in this version + const Ban + const EventValidationTooLarge + const Invite + const Join + const Knock + const Leave + const MDeviceListUpdate + const MDirectToDevice + const MPresence + const MReceipt + const MRoomAliases + const MRoomAvatar + const MRoomCanonicalAlias + const MRoomCreate + const MRoomEncryption + const MRoomGuestAccess + const MRoomHistoryVisibility + const MRoomJoinRules + const MRoomMember + const MRoomMembership + const MRoomName + const MRoomPowerLevels + const MRoomRedaction + const MRoomThirdPartyInvite + const MRoomTopic + const MTyping + const Peek + const Public + const PublicKeyNotExpired + const PublicKeyNotValid + const Restricted + const WellKnownMaxSize + const WorldReadable + var ErrCanonicalJSON = errors.New("value is outside of safe range") + func Allowed(event *Event, authEvents AuthEventProvider) error + func CanonicalJSON(input []byte) ([]byte, error) + func CanonicalJSONAssumeValid(input []byte) []byte + func CompactJSON(input, output []byte) []byte + func EnforcedCanonicalJSON(input []byte, roomVersion RoomVersion) ([]byte, error) + func IsValidCertificate(serverName ServerName, c *x509.Certificate, intermediates *x509.CertPool) (valid bool, err error) + func ParseAndValidateServerName(serverName ServerName) (host string, port int, valid bool) + func ParseAuthorization(header string) (scheme string, origin, destination ServerName, key KeyID, sig string) + func RawJSONFromResult(result gjson.Result, _ []byte) []byte + func RoomVersions() map[RoomVersion]RoomVersionDescription + func SignJSON(signingName string, keyID KeyID, privateKey ed25519.PrivateKey, message []byte) (signed []byte, err error) + func SortJSON(input, output []byte) []byte + func StableRoomVersions() map[RoomVersion]RoomVersionDescription + func SupportedRoomVersions() map[RoomVersion]RoomVersionDescription + func VerifyAllEventSignatures(ctx context.Context, events []*Event, verifier JSONVerifier) []error + func VerifyAuthRulesAtState(ctx context.Context, sp StateProvider, eventToVerify *HeaderedEvent, ...) error + func VerifyEventAuthChain(ctx context.Context, eventToVerify *HeaderedEvent, ...) error + func VerifyJSON(signingName string, keyID KeyID, publicKey ed25519.PublicKey, message []byte) error + type ApplicationServiceTransaction struct + Events []ClientEvent + type AuthChainProvider func(roomVer RoomVersion, eventIDs []string) ([]*Event, error) + type AuthEventProvider interface + Create func() (*Event, error) + JoinRules func() (*Event, error) + Member func(stateKey string) (*Event, error) + PowerLevels func() (*Event, error) + ThirdPartyInvite func(stateKey string) (*Event, error) + type AuthEvents struct + func NewAuthEvents(events []*Event) AuthEvents + func (a *AuthEvents) AddEvent(event *Event) error + func (a *AuthEvents) Create() (*Event, error) + func (a *AuthEvents) JoinRules() (*Event, error) + func (a *AuthEvents) Member(stateKey string) (*Event, error) + func (a *AuthEvents) PowerLevels() (*Event, error) + func (a *AuthEvents) ThirdPartyInvite(stateKey string) (*Event, error) + type BackfillClient interface + Backfill func(ctx context.Context, server ServerName, roomID string, limit int, ...) (Transaction, error) + type BackfillRequester interface + ProvideEvents func(roomVer RoomVersion, eventIDs []string) ([]*Event, error) + ServersAtEvent func(ctx context.Context, roomID, eventID string) []ServerName + type BadJSONError struct + func (e BadJSONError) Error() string + func (e BadJSONError) Unwrap() error + type Base64Bytes []byte + func (b64 *Base64Bytes) Decode(str string) error + func (b64 *Base64Bytes) Scan(src interface{}) error + func (b64 *Base64Bytes) UnmarshalJSON(raw []byte) (err error) + func (b64 *Base64Bytes) UnmarshalYAML(unmarshal func(interface{}) error) (err error) + func (b64 Base64Bytes) Encode() string + func (b64 Base64Bytes) MarshalJSON() ([]byte, error) + func (b64 Base64Bytes) MarshalYAML() (interface{}, error) + func (b64 Base64Bytes) Value() (driver.Value, error) + type Client struct + func NewClient(options ...ClientOption) *Client + func (fc *Client) CreateMediaDownloadRequest(ctx context.Context, matrixServer ServerName, mediaID string) (*http.Response, error) + func (fc *Client) DoHTTPRequest(ctx context.Context, req *http.Request) (*http.Response, error) + func (fc *Client) DoRequestAndParseResponse(ctx context.Context, req *http.Request, result interface{}) error + func (fc *Client) GetServerKeys(ctx context.Context, matrixServer ServerName) (ServerKeys, error) + func (fc *Client) GetVersion(ctx context.Context, s ServerName) (res Version, err error) + func (fc *Client) LookupServerKeys(ctx context.Context, matrixServer ServerName, ...) ([]ServerKeys, error) + func (fc *Client) LookupUserInfo(ctx context.Context, matrixServer ServerName, token string) (u UserInfo, err error) + func (fc *Client) SetUserAgent(ua string) + type ClientEvent struct + Content RawJSON + EventID string + OriginServerTS Timestamp + Redacts string + RoomID string + Sender string + StateKey *string + Type string + Unsigned RawJSON + func HeaderedToClientEvent(se *HeaderedEvent, format ClientEventFormat) ClientEvent + func HeaderedToClientEvents(serverEvs []*HeaderedEvent, format ClientEventFormat) []ClientEvent + func ToClientEvent(se *Event, format ClientEventFormat) ClientEvent + func ToClientEvents(serverEvs []*Event, format ClientEventFormat) []ClientEvent + type ClientEventFormat int + const FormatAll + const FormatSync + type ClientOption func(*clientOptions) + func WithDNSCache(cache *DNSCache) ClientOption + func WithKeepAlives(keepAlives bool) ClientOption + func WithSkipVerify(skipVerify bool) ClientOption + func WithTimeout(duration time.Duration) ClientOption + func WithTransport(transport http.RoundTripper) ClientOption + type CreateContent struct + Creator string + Federate *bool + Predecessor PreviousRoom + RoomVersion *RoomVersion + func NewCreateContentFromAuthEvents(authEvents AuthEventProvider) (c CreateContent, err error) + func (c *CreateContent) DomainAllowed(domain string) error + func (c *CreateContent) UserIDAllowed(id string) error + type CrossSigningBody interface + type CrossSigningForKeyOrDevice struct + func (c *CrossSigningForKeyOrDevice) UnmarshalJSON(b []byte) error + func (c CrossSigningForKeyOrDevice) MarshalJSON() ([]byte, error) + type CrossSigningKey struct + Keys map[KeyID]Base64Bytes + Signatures map[string]map[KeyID]Base64Bytes + Usage []CrossSigningKeyPurpose + UserID string + type CrossSigningKeyPurpose string + const CrossSigningKeyPurposeMaster + const CrossSigningKeyPurposeSelfSigning + const CrossSigningKeyPurposeUserSigning + type CrossSigningKeys struct + MasterKey CrossSigningKey + SelfSigningKey CrossSigningKey + UserSigningKey CrossSigningKey + type DNSCache struct + func NewDNSCache(size int, duration time.Duration) *DNSCache + func (c *DNSCache) DialContext(ctx context.Context, network, address string) (net.Conn, error) + type DeviceKeys struct + Unsigned map[string]interface{} + func (s *DeviceKeys) Scan(src interface{}) error + func (s DeviceKeys) Value() (driver.Value, error) + type DeviceListUpdateEvent struct + Deleted bool + DeviceDisplayName string + DeviceID string + Keys json.RawMessage + PrevID []int64 + StreamID int64 + UserID string + type DirectKeyFetcher struct + Client KeyClient + func (d *DirectKeyFetcher) FetchKeys(ctx context.Context, requests map[PublicKeyLookupRequest]Timestamp) (map[PublicKeyLookupRequest]PublicKeyLookupResult, error) + func (d DirectKeyFetcher) FetcherName() string + type EDU struct + Content RawJSON + Destination string + Origin string + Type string + type Ed25519Checks struct + MatchingSignature bool + ValidEd25519 bool + type Event struct + func NewEventFromTrustedJSON(eventJSON []byte, redacted bool, roomVersion RoomVersion) (result *Event, err error) + func NewEventFromTrustedJSONWithEventID(eventID string, eventJSON []byte, redacted bool, roomVersion RoomVersion) (result *Event, err error) + func NewEventFromUntrustedJSON(eventJSON []byte, roomVersion RoomVersion) (result *Event, err error) + func ResolveConflicts(version RoomVersion, events []*Event, authEvents []*Event) ([]*Event, error) + func ResolveStateConflicts(conflicted []*Event, authEvents []*Event) []*Event + func ResolveStateConflictsV2(conflicted, unconflicted []*Event, authEvents, authDifference []*Event) []*Event + func ReverseTopologicalOrdering(input []*Event, order TopologicalOrder) []*Event + func UnwrapEventHeaders(in []*HeaderedEvent) []*Event + func (e *Event) AuthEventIDs() []string + func (e *Event) AuthEvents() []EventReference + func (e *Event) CheckFields() error + func (e *Event) Content() []byte + func (e *Event) Depth() int64 + func (e *Event) EventID() string + func (e *Event) EventReference() EventReference + func (e *Event) Headered(roomVersion RoomVersion) *HeaderedEvent + func (e *Event) HistoryVisibility() (string, error) + func (e *Event) JSON() []byte + func (e *Event) JoinRule() (string, error) + func (e *Event) KeyIDs(signingName string) []KeyID + func (e *Event) Membership() (string, error) + func (e *Event) Origin() ServerName + func (e *Event) OriginServerTS() Timestamp + func (e *Event) PowerLevels() (*PowerLevelContent, error) + func (e *Event) PrevEventIDs() []string + func (e *Event) PrevEvents() []EventReference + func (e *Event) Redact() *Event + func (e *Event) Redacted() bool + func (e *Event) Redacts() string + func (e *Event) RoomID() string + func (e *Event) Sender() string + func (e *Event) SetUnsigned(unsigned interface{}) (*Event, error) + func (e *Event) SetUnsignedField(path string, value interface{}) error + func (e *Event) Sign(signingName string, keyID KeyID, privateKey ed25519.PrivateKey) Event + func (e *Event) StateKey() *string + func (e *Event) StateKeyEquals(stateKey string) bool + func (e *Event) Type() string + func (e *Event) Unsigned() []byte + func (e *Event) VerifyEventSignatures(ctx context.Context, verifier JSONVerifier) error + func (e *Event) Version() RoomVersion + func (e Event) MarshalJSON() ([]byte, error) + type EventBuilder struct + AuthEvents interface{} + Content RawJSON + Depth int64 + PrevEvents interface{} + Redacts string + RoomID string + Sender string + Signature RawJSON + StateKey *string + Type string + Unsigned RawJSON + func (eb *EventBuilder) Build(now time.Time, origin ServerName, keyID KeyID, privateKey ed25519.PrivateKey, ...) (result *Event, err error) + func (eb *EventBuilder) SetContent(content interface{}) (err error) + func (eb *EventBuilder) SetUnsigned(unsigned interface{}) (err error) + type EventFilter struct + Limit int + NotSenders *[]string + NotTypes *[]string + Senders *[]string + Types *[]string + func DefaultEventFilter() EventFilter + type EventFormat int + const EventFormatV1 + const EventFormatV2 + type EventIDFormat int + const EventIDFormatV1 + const EventIDFormatV2 + const EventIDFormatV3 + type EventJSONs []RawJSON + func NewEventJSONsFromEvents(he []*Event) EventJSONs + func NewEventJSONsFromHeaderedEvents(he []*HeaderedEvent) EventJSONs + func (e EventJSONs) TrustedEvents(roomVersion RoomVersion, redacted bool) []*Event + func (e EventJSONs) UntrustedEvents(roomVersion RoomVersion) []*Event + type EventLoadResult struct + Error error + Event *HeaderedEvent + SoftFail bool + type EventReference struct + EventID string + EventSHA256 Base64Bytes + func (er *EventReference) UnmarshalJSON(data []byte) error + func (er EventReference) MarshalJSON() ([]byte, error) + type EventValidationError struct + Code int + Message string + 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 FederatedStateClient interface + LookupState func(ctx context.Context, s ServerName, roomID, eventID string, ...) (res RespState, err error) + LookupStateIDs func(ctx context.Context, s ServerName, roomID, eventID string) (res RespStateIDs, err error) + type FederatedStateProvider struct + AuthEventMap map[string]*Event + EventToAuthEventIDs map[string][]string + FedClient FederatedStateClient + RememberAuthEvents bool + Server ServerName + func (p *FederatedStateProvider) StateBeforeEvent(ctx context.Context, roomVer RoomVersion, event *HeaderedEvent, ...) (map[string]*Event, error) + func (p *FederatedStateProvider) StateIDsBeforeEvent(ctx context.Context, event *HeaderedEvent) ([]string, error) + type FederationClient struct + func NewFederationClient(serverName ServerName, keyID KeyID, privateKey ed25519.PrivateKey, ...) *FederationClient + func (ac *FederationClient) Backfill(ctx context.Context, s ServerName, roomID string, limit int, eventIDs []string) (res Transaction, err error) + func (ac *FederationClient) ClaimKeys(ctx context.Context, s ServerName, oneTimeKeys map[string]map[string]string) (res RespClaimKeys, err error) + func (ac *FederationClient) ExchangeThirdPartyInvite(ctx context.Context, s ServerName, builder EventBuilder) (err error) + func (ac *FederationClient) GetEvent(ctx context.Context, s ServerName, eventID string) (res Transaction, err error) + func (ac *FederationClient) GetEventAuth(ctx context.Context, s ServerName, roomVersion RoomVersion, ...) (res RespEventAuth, err error) + func (ac *FederationClient) GetPublicRooms(ctx context.Context, s ServerName, limit int, since string, ...) (res RespPublicRooms, err error) + func (ac *FederationClient) GetPublicRoomsFiltered(ctx context.Context, s ServerName, limit int, since, filter string, ...) (res RespPublicRooms, err error) + func (ac *FederationClient) GetUserDevices(ctx context.Context, s ServerName, userID string) (res RespUserDevices, err error) + func (ac *FederationClient) LookupMissingEvents(ctx context.Context, s ServerName, roomID string, missing MissingEvents, ...) (res RespMissingEvents, err error) + func (ac *FederationClient) LookupProfile(ctx context.Context, s ServerName, userID string, field string) (res RespProfile, err error) + func (ac *FederationClient) LookupRoomAlias(ctx context.Context, s ServerName, roomAlias string) (res RespDirectory, err error) + func (ac *FederationClient) LookupState(ctx context.Context, s ServerName, roomID, eventID string, ...) (res RespState, err error) + func (ac *FederationClient) LookupStateIDs(ctx context.Context, s ServerName, roomID, eventID string) (res RespStateIDs, err error) + func (ac *FederationClient) MSC2836EventRelationships(ctx context.Context, dst ServerName, r MSC2836EventRelationshipsRequest, ...) (res MSC2836EventRelationshipsResponse, err error) + func (ac *FederationClient) MSC2946Spaces(ctx context.Context, dst ServerName, roomID string, suggestedOnly bool) (res MSC2946SpacesResponse, err error) + func (ac *FederationClient) MakeJoin(ctx context.Context, s ServerName, roomID, userID string, ...) (res RespMakeJoin, err error) + func (ac *FederationClient) MakeLeave(ctx context.Context, s ServerName, roomID, userID string) (res RespMakeLeave, err error) + func (ac *FederationClient) Peek(ctx context.Context, s ServerName, roomID, peekID string, ...) (res RespPeek, err error) + func (ac *FederationClient) QueryKeys(ctx context.Context, s ServerName, keys map[string][]string) (res RespQueryKeys, err error) + func (ac *FederationClient) SendInvite(ctx context.Context, s ServerName, event *Event) (res RespInvite, err error) + func (ac *FederationClient) SendInviteV2(ctx context.Context, s ServerName, request InviteV2Request) (res RespInviteV2, err error) + func (ac *FederationClient) SendJoin(ctx context.Context, s ServerName, event *Event) (res RespSendJoin, err error) + func (ac *FederationClient) SendJoinPartialState(ctx context.Context, s ServerName, event *Event) (res RespSendJoin, err error) + func (ac *FederationClient) SendLeave(ctx context.Context, s ServerName, event *Event) (err error) + func (ac *FederationClient) SendTransaction(ctx context.Context, t Transaction) (res RespSend, err error) + type FederationRequest struct + func NewFederationRequest(method string, destination ServerName, requestURI string) FederationRequest + func VerifyHTTPRequest(req *http.Request, now time.Time, destination ServerName, keys JSONVerifier) (*FederationRequest, util.JSONResponse) + func (r *FederationRequest) Content() []byte + func (r *FederationRequest) Destination() ServerName + func (r *FederationRequest) HTTPRequest() (*http.Request, error) + func (r *FederationRequest) Method() string + func (r *FederationRequest) Origin() ServerName + func (r *FederationRequest) RequestURI() string + func (r *FederationRequest) SetContent(content interface{}) error + func (r *FederationRequest) Sign(serverName ServerName, keyID KeyID, privateKey ed25519.PrivateKey) error + type Filter struct + AccountData EventFilter + EventFields []string + EventFormat string + Presence EventFilter + Room RoomFilter + func DefaultFilter() Filter + func (filter *Filter) Validate() error + type HeaderedEvent struct + RoomVersion RoomVersion + func HeaderedReverseTopologicalOrdering(events []*HeaderedEvent, order TopologicalOrder) []*HeaderedEvent + func RequestBackfill(ctx context.Context, b BackfillRequester, keyRing JSONVerifier, roomID string, ...) ([]*HeaderedEvent, error) + func (e *HeaderedEvent) UnmarshalJSON(data []byte) error + func (e *HeaderedEvent) UnmarshalJSONWithEventID(data []byte, eventID string) error + func (e *HeaderedEvent) Unwrap() *Event + func (e HeaderedEvent) MarshalJSON() ([]byte, error) + type HexString []byte + func (h *HexString) UnmarshalJSON(raw []byte) (err error) + func (h HexString) MarshalJSON() ([]byte, error) + type HistoryVisibilityContent struct + HistoryVisibility string + type InviteV2Request struct + func NewInviteV2Request(event *HeaderedEvent, state []InviteV2StrippedState) (request InviteV2Request, err error) + func (i *InviteV2Request) Event() *Event + func (i *InviteV2Request) InviteRoomState() []InviteV2StrippedState + func (i *InviteV2Request) RoomVersion() RoomVersion + func (i *InviteV2Request) UnmarshalJSON(data []byte) error + func (i InviteV2Request) MarshalJSON() ([]byte, error) + type InviteV2StrippedState struct + func NewInviteV2StrippedState(event *Event) (ss InviteV2StrippedState) + func (i *InviteV2StrippedState) Content() RawJSON + func (i *InviteV2StrippedState) Sender() string + func (i *InviteV2StrippedState) StateKey() *string + func (i *InviteV2StrippedState) Type() string + func (i *InviteV2StrippedState) UnmarshalJSON(data []byte) error + func (i InviteV2StrippedState) MarshalJSON() ([]byte, error) + type JSONVerifier interface + VerifyJSONs func(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 ServerName, now time.Time, keys ServerKeys) (checks KeyChecks, ed25519Keys map[KeyID]Base64Bytes) + type KeyClient interface + GetServerKeys func(ctx context.Context, matrixServer ServerName) (ServerKeys, error) + LookupServerKeys func(ctx context.Context, matrixServer 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]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 MSC2836EventRelationshipsRequest struct + AutoJoin bool + Batch string + DepthFirst bool + Direction string + EventID string + IncludeChildren bool + IncludeParent bool + Limit int + MaxBreadth int + MaxDepth int + RecentFirst bool + func NewMSC2836EventRelationshipsRequest(body io.Reader) (*MSC2836EventRelationshipsRequest, error) + func (r *MSC2836EventRelationshipsRequest) Defaults() + type MSC2836EventRelationshipsResponse struct + AuthChain EventJSONs + Events EventJSONs + Limited bool + NextBatch string + type MSC2946Room struct + AllowedRoomIDs []string + ChildrenState []MSC2946StrippedEvent + RoomType string + type MSC2946SpacesResponse struct + Children []MSC2946Room + InaccessibleChildren []string + Room MSC2946Room + type MSC2946StrippedEvent struct + Content json.RawMessage + OriginServerTS Timestamp + RoomID string + Sender string + StateKey string + Type string + type MemberContent struct + AuthorisedVia string + AvatarURL string + DisplayName string + IsDirect bool + Membership string + Reason string + ThirdPartyInvite *MemberThirdPartyInvite + func NewMemberContentFromAuthEvents(authEvents AuthEventProvider, userID string) (c MemberContent, err error) + func NewMemberContentFromEvent(event *Event) (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 MissingAuthEventError struct + AuthEventID string + ForEventID string + func (e MissingAuthEventError) Error() string + type MissingEvents struct + EarliestEvents []string + LatestEvents []string + Limit int + MinDepth int + type NotAllowed struct + Message string + func (a *NotAllowed) Error() string + type OldVerifyKey struct + ExpiredTS Timestamp + type PDUResult struct + Error string + type PerspectiveKeyFetcher struct + Client KeyClient + PerspectiveServerKeys map[KeyID]ed25519.PublicKey + PerspectiveServerName ServerName + func (p *PerspectiveKeyFetcher) FetchKeys(ctx context.Context, requests map[PublicKeyLookupRequest]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 *Event) (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(userID string) int64 + type PreviousRoom struct + EventID string + RoomID string + type PublicKey struct + KeyValidityURL string + PublicKey Base64Bytes + type PublicKeyLookupRequest struct + KeyID KeyID + ServerName ServerName + func (r *PublicKeyLookupRequest) UnmarshalText(text []byte) error + func (r PublicKeyLookupRequest) MarshalText() ([]byte, error) + type PublicKeyLookupResult struct + ExpiredTS Timestamp + ValidUntilTS Timestamp + func (r PublicKeyLookupResult) WasValidAt(atTs Timestamp, strictValidityChecking bool) bool + type PublicKeyNotaryLookupRequest struct + ServerKeys map[ServerName]map[KeyID]PublicKeyNotaryQueryCriteria + type PublicKeyNotaryQueryCriteria struct + MinimumValidUntilTS Timestamp + type PublicRoom struct + Aliases []string + AvatarURL string + CanonicalAlias string + GuestCanJoin bool + JoinedMembersCount int + Name string + RoomID string + Topic string + WorldReadable bool + type RawJSON []byte + func (e RawJSON) TrustedEvent(roomVersion RoomVersion, redacted bool) (*Event, error) + func (e RawJSON) UntrustedEvent(roomVersion RoomVersion) (*Event, error) + func (r *RawJSON) UnmarshalJSON(data []byte) error + func (r RawJSON) MarshalJSON() ([]byte, error) + type RedactionAlgorithm int + const RedactionAlgorithmV1 + const RedactionAlgorithmV2 + const RedactionAlgorithmV3 + const RedactionAlgorithmV4 + type ResolutionResult struct + Destination string + Host ServerName + TLSServerName string + func ResolveServer(ctx context.Context, serverName ServerName) (results []ResolutionResult, err error) + type RespClaimKeys struct + OneTimeKeys map[string]map[string]map[string]json.RawMessage + type RespDirectory struct + RoomID string + Servers []ServerName + type RespEventAuth struct + AuthEvents EventJSONs + type RespInvite struct + Event RawJSON + func (r *RespInvite) UnmarshalJSON(data []byte) error + func (r RespInvite) MarshalJSON() ([]byte, error) + type RespInviteV2 struct + Event RawJSON + type RespMakeJoin struct + JoinEvent EventBuilder + RoomVersion RoomVersion + type RespMakeLeave struct + LeaveEvent EventBuilder + RoomVersion RoomVersion + type RespMissingEvents struct + Events EventJSONs + type RespPeek struct + AuthEvents EventJSONs + LatestEvent *Event + RenewalInterval int64 + RoomVersion RoomVersion + StateEvents EventJSONs + func (r RespPeek) MarshalJSON() ([]byte, error) + func (r RespPeek) ToRespState() RespState + type RespProfile struct + AvatarURL string + DisplayName string + type RespPublicRooms struct + Chunk []PublicRoom + NextBatch string + PrevBatch string + TotalRoomCountEstimate int + type RespQueryKeys struct + DeviceKeys map[string]map[string]DeviceKeys + MasterKeys map[string]CrossSigningKey + SelfSigningKeys map[string]CrossSigningKey + type RespSend struct + PDUs map[string]PDUResult + type RespSendJoin struct + AuthEvents EventJSONs + Event *Event + Origin ServerName + PartialState bool + ServersInRoom []string + StateEvents EventJSONs + func (r *RespSendJoin) Check(ctx context.Context, roomVersion RoomVersion, keyRing JSONVerifier, ...) (*RespState, error) + func (r RespSendJoin) MarshalJSON() ([]byte, error) + func (r RespSendJoin) ToRespState() RespState + type RespState struct + AuthEvents EventJSONs + StateEvents EventJSONs + func (r *RespState) Check(ctx context.Context, roomVersion RoomVersion, keyRing JSONVerifier, ...) ([]*Event, []*Event, error) + func (r RespState) Events(roomVersion RoomVersion) []*Event + func (r RespState) MarshalJSON() ([]byte, error) + type RespStateIDs struct + AuthEventIDs []string + StateEventIDs []string + type RespUserDevice struct + DeviceID string + DisplayName string + Keys RespUserDeviceKeys + type RespUserDeviceKeys struct + Algorithms []string + DeviceID string + Keys map[KeyID]Base64Bytes + Signatures map[string]map[KeyID]Base64Bytes + UserID string + type RespUserDevices struct + Devices []RespUserDevice + MasterKey *CrossSigningKey + SelfSigningKey *CrossSigningKey + StreamID int64 + UserID string + type RoomEventFilter struct + ContainsURL *bool + IncludeRedundantMembers bool + LazyLoadMembers bool + Limit int + NotRooms *[]string + NotSenders *[]string + NotTypes *[]string + Rooms *[]string + Senders *[]string + Types *[]string + func DefaultRoomEventFilter() RoomEventFilter + type RoomFilter struct + AccountData RoomEventFilter + Ephemeral RoomEventFilter + IncludeLeave bool + NotRooms *[]string + Rooms *[]string + State StateFilter + Timeline RoomEventFilter + type RoomVersion string + const RoomVersionV1 + const RoomVersionV2 + const RoomVersionV3 + const RoomVersionV4 + const RoomVersionV5 + const RoomVersionV6 + const RoomVersionV7 + const RoomVersionV8 + const RoomVersionV9 + func (v RoomVersion) AllowKnockingInEventAuth() (bool, error) + func (v RoomVersion) AllowRestrictedJoinsInEventAuth() (bool, error) + func (v RoomVersion) EnforceCanonicalJSON() (bool, error) + func (v RoomVersion) EventFormat() (EventFormat, error) + func (v RoomVersion) EventIDFormat() (EventIDFormat, error) + func (v RoomVersion) PowerLevelsIncludeNotifications() (bool, error) + func (v RoomVersion) RedactionAlgorithm() (RedactionAlgorithm, error) + func (v RoomVersion) RequireIntegerPowerLevels() (bool, error) + func (v RoomVersion) StateResAlgorithm() (StateResAlgorithm, error) + func (v RoomVersion) StrictValidityChecking() (bool, error) + type RoomVersionDescription struct + Stable bool + Supported bool + type SendToDeviceEvent struct + Content json.RawMessage + Sender string + Type string + type ServerKeyFields struct + OldVerifyKeys map[KeyID]OldVerifyKey + ServerName ServerName + ValidUntilTS 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 Timestamp) []byte + type ServerName string + func SplitID(sigil byte, id string) (local string, domain ServerName, err error) + type StateFilter struct + ContainsURL *bool + IncludeRedundantMembers bool + LazyLoadMembers bool + Limit int + NotRooms *[]string + NotSenders *[]string + NotTypes *[]string + Rooms *[]string + Senders *[]string + Types *[]string + func DefaultStateFilter() StateFilter + type StateKeyTuple struct + EventType string + StateKey string + type StateNeeded struct + Create bool + JoinRules bool + Member []string + PowerLevels bool + ThirdPartyInvite []string + func StateNeededForAuth(events []*Event) (result StateNeeded) + func StateNeededForEventBuilder(builder *EventBuilder) (result StateNeeded, err error) + func (s StateNeeded) AuthEventReferences(provider AuthEventProvider) (refs []EventReference, err error) + func (s StateNeeded) Tuples() (res []StateKeyTuple) + type StateProvider interface + StateBeforeEvent func(ctx context.Context, roomVer RoomVersion, event *HeaderedEvent, ...) (map[string]*Event, error) + StateIDsBeforeEvent func(ctx context.Context, event *HeaderedEvent) ([]string, error) + type StateResAlgorithm int + const StateResV1 + const StateResV2 + type ThirdPartyInviteContent struct + DisplayName string + KeyValidityURL string + PublicKey string + PublicKeys []PublicKey + func NewThirdPartyInviteContentFromAuthEvents(authEvents AuthEventProvider, token string) (t ThirdPartyInviteContent, err error) + type Timestamp uint64 + func AsTimestamp(t time.Time) Timestamp + func (t Timestamp) Time() time.Time + 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 ServerName + EDUs []EDU + Origin ServerName + OriginServerTS Timestamp + PDUs []json.RawMessage + PreviousIDs []TransactionID + TransactionID TransactionID + type TransactionID string + type UnexpectedHeaderedEvent struct + func (u UnexpectedHeaderedEvent) Error() string + type UnsupportedRoomVersionError struct + Version RoomVersion + func (e UnsupportedRoomVersionError) Error() string + type UserInfo struct + Sub string + type VerifyJSONRequest struct + AtTS Timestamp + Message []byte + ServerName ServerName + StrictValidityChecking bool + type VerifyJSONResult struct + Error error + type VerifyKey struct + Key Base64Bytes + type Version struct + Server struct{ ... } + type WellKnownResult struct + CacheExpiresAt int64 + NewAddress ServerName + func LookupWellKnown(ctx context.Context, serverNameType ServerName) (*WellKnownResult, error)