repositories

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package repositories represents data storage/source for miounne

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCryptoStore added in v1.1.0

func NewCryptoStore(db *sql.DB, driver string, logger crypto.Logger, userID id.UserID, deviceID id.DeviceID) (*crypto.SQLCryptoStore, error)

NewCryptoStore ...

Types

type Registration added in v1.1.0

type Registration struct {
	// contains filtered or unexported fields
}

Registration matrix-registration integration

func NewRegistration added in v1.1.0

func NewRegistration(url string, secret string, roomID id.RoomID) *Registration

NewRegistration object

func (*Registration) CreateToken added in v1.1.0

func (c *Registration) CreateToken(maxUsage, expirationDate string) (*models.RegistrationToken, error)

CreateToken ...

func (*Registration) DisableToken added in v1.1.0

func (c *Registration) DisableToken(token string) (*models.RegistrationToken, error)

DisableToken ...

func (*Registration) GetList added in v1.1.0

func (c *Registration) GetList() ([]models.RegistrationToken, error)

GetList of invite tokens

func (*Registration) GetRoomID added in v1.1.0

func (c *Registration) GetRoomID() id.RoomID

GetRoomID of control room

func (*Registration) GetStatus added in v1.1.0

func (c *Registration) GetStatus(token string) (*models.RegistrationToken, error)

GetStatus of matrix-registration token

type SQL added in v1.1.0

type SQL struct {
	// contains filtered or unexported fields
}

SQL implements mautrix.Storer and mautrix/crypto.StateStore interfaces, based on git.sr.ht/~sumner/standupbot StateStore

func NewSQLStore added in v1.1.0

func NewSQLStore(db *sql.DB, driver string, logger crypto.Logger) *SQL

NewSQLStore sqlite/postgres persistent storage

func (*SQL) CreateTables added in v1.1.0

func (store *SQL) CreateTables() error

CreateTables == migrations

func (*SQL) FindSharedRooms added in v1.1.0

func (store *SQL) FindSharedRooms(userID id.UserID) []id.RoomID

FindSharedRooms returns list of known rooms where userID is member

func (*SQL) GetEncryptionEvent added in v1.1.0

func (store *SQL) GetEncryptionEvent(roomID id.RoomID) *event.EncryptionEventContent

GetEncryptionEvent for room

func (*SQL) GetRoomMembers added in v1.1.0

func (store *SQL) GetRoomMembers(roomID id.RoomID) []id.UserID

GetRoomMembers ...

func (*SQL) IsEncrypted added in v1.1.0

func (store *SQL) IsEncrypted(roomID id.RoomID) bool

IsEncrypted returns whether a room is encrypted.

func (*SQL) LoadFilterID added in v1.1.0

func (store *SQL) LoadFilterID(userID id.UserID) string

LoadFilterID ...

func (*SQL) LoadNextBatch added in v1.1.0

func (store *SQL) LoadNextBatch(userID id.UserID) string

LoadNextBatch token for /sync

func (*SQL) LoadRoom added in v1.1.0

func (store *SQL) LoadRoom(roomID id.RoomID) *mautrix.Room

LoadRoom is passthrought to mautrix.NewRoom(), because Miounne doesn't need it

func (*SQL) SaveFilterID added in v1.1.0

func (store *SQL) SaveFilterID(userID id.UserID, filterID string)

SaveFilterID ...

func (*SQL) SaveNextBatch added in v1.1.0

func (store *SQL) SaveNextBatch(userID id.UserID, nextBatchToken string)

SaveNextBatch token for /sync

func (*SQL) SaveRoom added in v1.1.0

func (store *SQL) SaveRoom(_ *mautrix.Room)

SaveRoom is empty function, because Miounne doesn't need it

func (*SQL) SetEncryptionEvent added in v1.1.0

func (store *SQL) SetEncryptionEvent(event *event.Event)

SetEncryptionEvent is wrapper of upsertEncryptionEvent

func (*SQL) SetMembership added in v1.1.0

func (store *SQL) SetMembership(event *event.Event)

SetMembership saves room members

Directories

Path Synopsis
Package formext represents form extensions
Package formext represents form extensions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL