memory

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbDriver

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

DbDriver is a database driver for in-memory database for testing

func MakeMemoryDBDriver

func MakeMemoryDBDriver(log slog.Instance) *DbDriver

MakeMemoryDBDriver creates a new database driver for rethinkdb

func (*DbDriver) AddGPGKey

func (h *DbDriver) AddGPGKey(key models.GPGKey) (string, bool, error)

AddGPGKey adds a GPG Key to the database or update an existing one by fingerprint Returns generated id / hasBeenAdded / error

func (*DbDriver) AddGPGKeys

func (h *DbDriver) AddGPGKeys(keys []models.GPGKey) (ids []string, addeds []bool, err error)

AddGPGKey adds a list GPG Key to the database or update an existing one by fingerprint Same as AddGPGKey but in a single transaction

func (*DbDriver) AddUser

func (h *DbDriver) AddUser(um models.User) (string, error)

func (*DbDriver) AddUserToken

func (h *DbDriver) AddUserToken(ut models.UserToken) (string, error)

func (*DbDriver) DeleteGPGKey

func (h *DbDriver) DeleteGPGKey(key models.GPGKey) error

func (*DbDriver) FetchGPGKeyByFingerprint

func (h *DbDriver) FetchGPGKeyByFingerprint(fingerprint string) (*models.GPGKey, error)

func (*DbDriver) FetchGPGKeysWithoutSubKeys

func (h *DbDriver) FetchGPGKeysWithoutSubKeys() ([]models.GPGKey, error)

func (*DbDriver) FindGPGKeyByEmail

func (h *DbDriver) FindGPGKeyByEmail(email string, pageStart, pageEnd int) ([]models.GPGKey, error)

func (*DbDriver) FindGPGKeyByFingerPrint

func (h *DbDriver) FindGPGKeyByFingerPrint(fingerprint string, pageStart, pageEnd int) ([]models.GPGKey, error)

func (*DbDriver) FindGPGKeyByName

func (h *DbDriver) FindGPGKeyByName(name string, pageStart, pageEnd int) ([]models.GPGKey, error)

func (*DbDriver) FindGPGKeyByValue

func (h *DbDriver) FindGPGKeyByValue(value string, pageStart, pageEnd int) ([]models.GPGKey, error)

func (*DbDriver) FinishCursor

func (h *DbDriver) FinishCursor() error

func (*DbDriver) GetUser

func (h *DbDriver) GetUser(username string) (um *models.User, err error)

func (*DbDriver) GetUserToken

func (h *DbDriver) GetUserToken(token string) (ut *models.UserToken, err error)

func (*DbDriver) HealthCheck

func (h *DbDriver) HealthCheck() error

func (*DbDriver) InitCursor

func (h *DbDriver) InitCursor() error

func (*DbDriver) InvalidateUserTokens

func (h *DbDriver) InvalidateUserTokens() (int, error)

func (*DbDriver) NextGPGKey

func (h *DbDriver) NextGPGKey(key *models.GPGKey) bool

func (*DbDriver) NextUser

func (h *DbDriver) NextUser(user *models.User) bool

func (*DbDriver) NumGPGKeys

func (h *DbDriver) NumGPGKeys() (int, error)

func (*DbDriver) RemoveUserToken

func (h *DbDriver) RemoveUserToken(token string) (err error)

RemoveUserToken removes a user token from the database

func (*DbDriver) UpdateGPGKey

func (h *DbDriver) UpdateGPGKey(key models.GPGKey) error

func (*DbDriver) UpdateUser

func (h *DbDriver) UpdateUser(um models.User) error

Jump to

Keyboard shortcuts

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