rql

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RethinkDBDriver

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

RethinkDBDriver is a database driver for RethinkDB

func MakeRethinkDBDriver

func MakeRethinkDBDriver(log slog.Instance) *RethinkDBDriver

MakeRethinkDBDriver creates a new database driver for rethinkdb

func (*RethinkDBDriver) AddGPGKey

func (h *RethinkDBDriver) 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 (*RethinkDBDriver) AddGPGKeys

func (h *RethinkDBDriver) 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 (*RethinkDBDriver) AddUser

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

func (*RethinkDBDriver) AddUserToken

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

AddUserToken adds a new user token to be valid and returns its token ID

func (*RethinkDBDriver) Connect

func (h *RethinkDBDriver) Connect(host, username, password, database string, port, poolSize int) error

func (*RethinkDBDriver) DeleteGPGKey

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

DeleteGPGKey deletes the specified GPG key by using it's ID

func (*RethinkDBDriver) FetchGPGKeyByFingerprint

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

FetchGPGKeyByFingerprint fetch a GPG Key by its fingerprint

func (*RethinkDBDriver) FetchGPGKeysWithoutSubKeys

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

FetchGPGKeysWithoutSubKeys fetch all keys that does not have a subkey

func (*RethinkDBDriver) FindGPGKeyByEmail

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

FindGPGKeyByEmail find all keys that has a underlying UID that contains that email

func (*RethinkDBDriver) FindGPGKeyByFingerPrint

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

FindGPGKeyByFingerPrint find all keys that has a fingerprint that matches the specified fingerprint

func (*RethinkDBDriver) FindGPGKeyByName

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

FindGPGKeyByName find all keys that has a underlying UID that contains that name

func (*RethinkDBDriver) FindGPGKeyByValue

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

FindGPGKeyByValue find all keys that has a underlying UID that contains that email, name or fingerprint specified by value

func (*RethinkDBDriver) FinishCursor

func (h *RethinkDBDriver) FinishCursor() error

func (*RethinkDBDriver) GetUser

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

func (*RethinkDBDriver) GetUserToken

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

GetUserToken fetch a UserToken object by the specified token

func (*RethinkDBDriver) HealthCheck

func (h *RethinkDBDriver) HealthCheck() error

HealthCheck returns nil if everything is OK with the handler

func (*RethinkDBDriver) InitCursor

func (h *RethinkDBDriver) InitCursor() error

func (*RethinkDBDriver) InitDatabase

func (h *RethinkDBDriver) InitDatabase() error

InitDatabase initializes indexes and tables required to operation

func (*RethinkDBDriver) InvalidateUserTokens

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

InvalidateUserTokens removes all user tokens that had been already expired

func (*RethinkDBDriver) NextGPGKey

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

func (*RethinkDBDriver) NextUser

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

func (*RethinkDBDriver) NumGPGKeys

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

func (*RethinkDBDriver) RemoveUserToken

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

RemoveUserToken removes a user token from the database

func (*RethinkDBDriver) ResetDatabase

func (h *RethinkDBDriver) ResetDatabase() error

func (*RethinkDBDriver) UpdateGPGKey

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

UpdateGPGKey updates the specified GPG key by using it's ID

func (*RethinkDBDriver) UpdateUser

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

Jump to

Keyboard shortcuts

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