package
0.0.0-20210922083416-9835270b055a
Repository: https://github.com/finogeeks/ligase.git
Documentation: pkg.go.dev

# README

homeserverlib

fork from github Go library for common functions needed by matrix servers.

# Packages

No description provided by the author

# Functions

No description provided by the author
Allowed checks whether an event is allowed by the auth events.
AsTimestamp turns a time.Time into a millisecond posix timestamp.
CanonicalJSON re-encodes the JSON in a canonical encoding.
CanonicalJSONAssumeValid is the same as CanonicalJSON, but assumes the input is valid JSON.
CheckKeys checks the keys returned from a server to make sure they are valid.
CompactJSON makes the encoded JSON as small as possible by removing whitespace and unneeded unicode escapes.
DefaultFilter returns the default filter used by the Matrix server if no filter is provided in the request.
DefaultFilterPart returns the default filter part used by the Matrix server if no filter is provided in the request.
FetchKeysDirect fetches the matrix keys directly from the given address.
ListKeyIDs lists the key IDs a given entity has signed a message with.
LookupServer looks up a matrix server in DNS.
NewAuthEvents returns an AuthEventProvider backed by the given events.
NewClient makes a new Client (with default timeout).
NewClientWithTimeout makes a new Client with a specified request timeout.
NewEventFromTrustedJSON loads a new event from some JSON that must be valid.
NewEventFromUntrustedJSON loads a new event from some JSON that may be invalid.
NewFederationClient makes a new FederationClient.
NewFederationRequest creates a matrix request.
NewHttpClient makes a new Client (with default timeout).
NewHttpClientWithTimeout makes a new Client with a specified request timeout.
ResolveStateConflicts takes a list of state events with conflicting state keys and works out which event should be used for each state event.
SignJSON signs a JSON object returning a copy signed with the given key.
SortJSON reencodes the JSON with the object keys sorted by lexicographically by codepoint.
SplitID splits a matrix ID into a local part and a server name.
StateNeededForAuth returns the event types and state_keys needed to authenticate an event.
StateNeededForEventBuilder returns the event types and state_keys needed to authenticate the event being built.
ToClientEvent converts a single server event to a client event.
ToClientEvents converts server events to client events.
ToContent converts a single server event to a client event.
VerifyAllEventSignatures checks that each event in a list of events has valid signatures from the server that sent it.
VerifyEventSignatures checks that each event in a list of events has valid signatures from the server that sent it.
VerifyHTTPRequest extracts and verifies the contents of a net/http.Request.
VerifyJSON checks that the entity has signed the message using a particular key.

# Constants

FormatAll will include all client event keys.
FormatSync will include only the event keys required by the /sync API.
customized for room meeting.
MRoomAliases https://matrix.org/docs/spec/client_server/r0.2.0.html#m-room-aliases.
channel archive.
MRoomCreate https://matrix.org/docs/spec/client_server/r0.2.0.html#m-room-create.
MRoomHistoryVisibility https://matrix.org/docs/spec/client_server/r0.2.0.html#m-room-history-visibility.
MRoomJoinRules https://matrix.org/docs/spec/client_server/r0.2.0.html#m-room-join-rules.
MRoomMember https://matrix.org/docs/spec/client_server/r0.2.0.html#m-room-member.
MRoomPowerLevels https://matrix.org/docs/spec/client_server/r0.2.0.html#m-room-power-levels.
MRoomRedaction https://matrix.org/docs/spec/client_server/r0.2.0.html#id21.
MRoomThirdPartyInvite https://matrix.org/docs/spec/client_server/r0.2.0.html#m-room-third-party-invite.
No description provided by the author
MTyping https://matrix.org/docs/spec/client_server/r0.3.0.html#m-typing.
PublicKeyNotExpired is a magic value for PublicKeyLookupResult.ExpiredTS: it indicates that this is an active key which has not yet expired.
PublicKeyNotValid is a magic value for PublicKeyLookupResult.ValidUntilTS: it is used when we don't have a validity period for this key.

# Structs

ApplicationServiceTransaction is the transaction that is sent off to an application service.
AuthEvents is an implementation of AuthEventProvider backed by a map.
No description provided by the author
No description provided by the author
ClaimRequest structure.
ClaimResponse structure.
A Client makes request to the federation listeners of matrix homeservers.
ClientEvent is an event which is fit for consumption by clients, in accordance with the specification.
DeviceKeysQuery structure.
A DirectKeyFetcher fetches keys directly from a server.
A DNSResult is the result of looking up a matrix server in DNS.
Ed25519Checks are the checks that are applied to Ed25519 keys in ServerKey responses.
EDU represents a EDU received via federation https://matrix.org/docs/spec/server_server/unstable.html#edus.
An Event is a matrix event.
An EventBuilder is used to build a new event.
An EventReference is a reference to a matrix event.
A FederationClient is a matrix federation client that adds "Authorization: X-Matrix" headers to requests that need ed25519 signatures.
A FederationRequest is a request to send to a remote server or a request received from a remote server.
Filter is used by clients to specify how the server should filter responses to e.g.
FilterPart is used to define filtering rules for specific categories of events.
A HostResult is the result of looking up the IP addresses for a host.
KeyChecks are the checks that should be applied to ServerKey responses.
A KeyRing stores keys for matrix servers and provides methods for verifying JSON messages.
No description provided by the author
A NotAllowed error is returned if an event does not pass the auth checks.
An OldVerifyKey is an old ed25519 public key that is no longer valid.
A PDUResult is the result of processing a matrix room event.
A PerspectiveKeyFetcher fetches server keys from a single perspective server.
A PublicKeyLookupRequest is a request for a public key with a particular key ID.
A PublicKeyLookupResult is the result of looking up a server signing key.
QueryRequest structure.
QueryResponse structure.
No description provided by the author
No description provided by the author
No description provided by the author
A RespDirectory is the content of a response to GET /_matrix/federation/v1/query/directory This is returned when looking up a room alias from a remote server.
No description provided by the author
A RespEventAuth is the content of a response to GET /_matrix/federation/v1/event_auth/{roomID}/{eventID}.
No description provided by the author
RespInvite is the content of a response to PUT /_matrix/federation/v1/invite/{roomID}/{eventID}.
A RespMakeJoin is the content of a response to GET /_matrix/federation/v1/make_join/{roomID}/{userID}.
A RespMakeLeave is the content of a response to GET /_matrix/federation/v1/make_leave/{roomID}/{userID}.
No description provided by the author
No description provided by the author
A RespSend is the content of a response to PUT /_matrix/federation/v1/send/{txnID}/.
A RespSendLeave is the content of a response to PUT /_matrix/federation/v1/send_leave/{roomID}/{eventID} It has the same data as a response to /state, but in a slightly different wire format.
A RespState is the content of a response to GET /_matrix/federation/v1/state/{roomID}/{eventID}.
A RespStateIDs is the content of a response to GET /_matrix/federation/v1/state_ids/{roomID}/{eventID}.
No description provided by the author
RoomFilter is used to define filtering rules for room events.
ServerKeyFields are the parsed JSON contents of the ed25519 signing keys published by a matrix server.
ServerKeys are the ed25519 signing keys published by a matrix server.
A StateKeyTuple is the combination of an event type and an event state key.
StateNeeded lists the event types and state_keys needed to authenticate an event.
A TLSFingerprint is a SHA256 hash of an X509 certificate.
TLSFingerprintChecks are the checks that are applied to TLS fingerprints in ServerKey responses.
A Transaction is used to push data from one matrix server to another matrix server.
UnsignedDeviceInfo structure.
UserInfo represents information about a user.
A VerifyJSONRequest is a request to check for a signature on a JSON message.
A VerifyJSONResult is the result of checking the signature of a JSON message.
A VerifyKey is a ed25519 public key for a server.

# Interfaces

AuthEventProvider provides auth_events for the authentication checks.
A JSONVerifier is an object which can verify the signatures of JSON messages.
A KeyDatabase is a store for caching public keys.
A KeyFetcher is a way of fetching public keys in bulk.

# Type aliases

A Base64String is a string of bytes that are base64 encoded when used in JSON.
EventFormat specifies the format of a client event.
A HexString is a string of bytes that are hex encoded when used in JSON.
A KeyID is the ID of a ed25519 key used to sign JSON.
A RespSendJoin is the content of a response to PUT /_matrix/federation/v1/send_join/{roomID}/{eventID} It has the same data as a response to /state, but in a slightly different wire format.
A ServerName is the name a matrix homeserver is identified by.
A Timestamp is a millisecond posix timestamp.
A TransactionID identifies a transaction sent by a matrix server to another matrix server.