sqlite

package
v0.0.0-...-3ddecfe Latest Latest
Warning

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

Go to latest
Published: May 5, 2018 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLite

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

SQLite implements a SQLite database for the db.DB interface

func (*SQLite) GetCurrentUser

func (s *SQLite) GetCurrentUser() (userR matrix.User, err error)

GetCurrentUser returns the current user including a ready gomatrix client

func (*SQLite) GetMessage

func (s *SQLite) GetMessage(eventID string) (messageR matrix.Message, err error)

GetMessage returns the Message where the id matches the eventID

func (*SQLite) GetRoom

func (s *SQLite) GetRoom(roomID string) (roomR matrix.Room, err error)

GetRoom returns the Room where the id matches the roomID

func (*SQLite) GetRooms

func (s *SQLite) GetRooms() (roomsR []matrix.Room, err error)

GetRooms returns all Rooms from the Database

func (*SQLite) GetUser

func (s *SQLite) GetUser(userID string) (userR matrix.User, err error)

GetUser returns a user matching the mxid of the argument

func (*SQLite) Init

func (s *SQLite) Init() (err error)

Init prepares the DB by opening it and creating the required tables if needed

func (*SQLite) Open

func (s *SQLite) Open() *sql.DB

Open returns the in Init() created db variable

func (*SQLite) SaveMessage

func (s *SQLite) SaveMessage(message matrix.Message) error

SaveMessage saves message Events to the DB

func (*SQLite) SaveRoom

func (s *SQLite) SaveRoom(Room matrix.Room) error

SaveRoom saves a Room into the sqlite DB

func (*SQLite) SaveUser

func (s *SQLite) SaveUser(user matrix.User) error

SaveUser saves a matrix User to the User table

Jump to

Keyboard shortcuts

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