Categorygithub.com/etkecc/go-linkpearl
modulepackage
0.0.0-20250116124126-9b61062f191e
Repository: https://github.com/etkecc/go-linkpearl.git
Documentation: pkg.go.dev

# README

linkpearl

more about that name

A wrapper around mautrix-go with infrastructure/glue code included

How to get

go get github.com/etkecc/go-linkpearl
lp, err := linkpearl.New(&linkpearl.Config{
	// your options here
})
if err != nil {
	panic(err)
}

go lp.Start()

TODO

  • Unit tests

Features

  • Zero configuration End-to-End encryption
  • Zero configuration persistent storage
  • Zero configuration session restores
  • Zero configuration room and user account data encryption with AES GCM (both keys and values)
  • Zero configuration room and user account data caching
  • Threads support
  • All wrapped components exported

# Functions

EventContains checks if raw event content contains specified field with specified values.
EventField returns field value from raw event content.
EventParent returns parent event ID (either from thread or from reply-to relation), like GetRelatesTo(), but with content and default return value.
EventRelatesTo uses evt as source for EventParent() and RelatesTo().
GetParent is nil-safe version of evt.Content.AsMessage().RelatesTo.(GetThreadParent()|GetReplyTo()).
New linkpearl.
NewCrypter creates new Crypter.
ParseContent parses event content according to evt.Type.
RelatesTo returns relation object of a matrix event (either threads with reply-to fallback or plain reply-to).
UnwrapError tries to unwrap a error into something meaningful, like mautrix.HTTPError or mautrix.RespError.

# Constants

DefaultAccountDataCache size.
DefaultEventsLimit for methods like lp.Threads() and lp.FindEventBy().
DefaultMaxRetries for operations like autojoin.
DefaultTypingTimeout in seconds for typing notifications.
DefaultUserAgent for HTTP requests.
MaxRetries is the maximum number of retries for sending a message.
DefaultTypingTimeout is the step delay for sending message retries.

# Variables

ErrInvalidData returned in provided encrypted data (ciphertext) is invalid.

# Structs

Config represents matrix config.
Crypter is special object that handles data encryption and decryption apart from Matrix' standard encryption.
Linkpearl object.
No description provided by the author
RespRelations is response of https://spec.matrix.org/v1.8/client-server-api/#get_matrixclientv1roomsroomidrelationseventidreltype.
RespThreads is response of https://spec.matrix.org/v1.8/client-server-api/#get_matrixclientv1roomsroomidthreads.