msc2946

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package msc2946 'Spaces Summary' implements https://github.com/matrix-org/matrix-doc/pull/2946

Index

Constants

View Source
const (
	ConstCreateEventContentKey = "org.matrix.msc1772.type"
	ConstSpaceChildEventType   = "org.matrix.msc1772.space.child"
	ConstSpaceParentEventType  = "org.matrix.msc1772.space.parent"
)

Variables

This section is empty.

Functions

func Defaults added in v0.3.7

Defaults sets the request defaults

func SpaceTarget

func SpaceTarget(he *gomatrixserverlib.HeaderedEvent) string

SpaceTarget returns the destination room ID for the space event. This is either a child or a parent depending on the event type.

Types

type DB

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

func (*DB) References

func (d *DB) References(ctx context.Context, roomID string) ([]*gomatrixserverlib.HeaderedEvent, error)

func (*DB) StoreReference

func (d *DB) StoreReference(ctx context.Context, he *gomatrixserverlib.HeaderedEvent) error

type Database

type Database interface {
	// StoreReference persists a child or parent space mapping.
	StoreReference(ctx context.Context, he *gomatrixserverlib.HeaderedEvent) error
	// References returns all events which have the given roomID as a parent or child space.
	References(ctx context.Context, roomID string) ([]*gomatrixserverlib.HeaderedEvent, error)
}

func NewDatabase

func NewDatabase(dbOpts *config.DatabaseOptions) (Database, error)

NewDatabase loads the database for msc2836

Jump to

Keyboard shortcuts

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