mxutils

package
v0.0.0-...-560a5fa Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MXLogin

func MXLogin(username string, token string) (mxclient *mautrix.Client, err error)

MXLogin

func MXRoom

func MXRoom(room string) (mxroom id.RoomID, err error)

func MXRoomAlias

func MXRoomAlias(alias string) (mxalias id.RoomAlias, err error)

func MXUserID

func MXUserID(username string) (mxuser id.UserID, err error)

func UnEmailHandle

func UnEmailHandle(h string) string

UnEmailHandle Takes a matrix handle, either in matrix or e-mail notation, and returns the handle in matrix notation

Types

type Entry

type Entry struct {
	Synapsehost string
	Localpart   string
	Domain      string
	Token       string
}

Entry represents a line in a MX passfile.

type Passfile

type Passfile struct {
	Entries []*Entry
}

Passfile is the in memory data structure representing a MX passfile.

func ParsePassfile

func ParsePassfile(r io.Reader) (*Passfile, error)

ParsePassfile reads r and parses it into a Passfile.

func ReadPassfile

func ReadPassfile(path string) (*Passfile, error)

ReadPassfile reads the file at path and parses it into a Passfile.

func (*Passfile) FindPassword

func (pf *Passfile) FindPassword(synapsehost, localpart, domain string) string

FindPassword finds the password for the provided synapsehost, localpart, and domain. An empty string will be returned if no match is found.

Jump to

Keyboard shortcuts

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