Documentation ¶
Index ¶
- type PostgreSQLDBDriver
- func (h *PostgreSQLDBDriver) AddGPGKey(key models.GPGKey) (string, bool, error)
- func (h *PostgreSQLDBDriver) AddGPGKeys(keys []models.GPGKey) (ids []string, addeds []bool, err error)
- func (h *PostgreSQLDBDriver) AddUser(um models.User) (string, error)
- func (h *PostgreSQLDBDriver) AddUserToken(ut models.UserToken) (string, error)
- func (h *PostgreSQLDBDriver) Connect(connectionString string) error
- func (h *PostgreSQLDBDriver) DeleteGPGKey(key models.GPGKey) error
- func (h *PostgreSQLDBDriver) FetchGPGKeyByFingerprint(fingerprint string) (*models.GPGKey, error)
- func (h *PostgreSQLDBDriver) FetchGPGKeysWithoutSubKeys() (res []models.GPGKey, err error)
- func (h *PostgreSQLDBDriver) FindGPGKeyByEmail(email string, pageStart, pageEnd int) ([]models.GPGKey, error)
- func (h *PostgreSQLDBDriver) FindGPGKeyByFingerPrint(fingerPrint string, pageStart, pageEnd int) ([]models.GPGKey, error)
- func (h *PostgreSQLDBDriver) FindGPGKeyByName(name string, pageStart, pageEnd int) ([]models.GPGKey, error)
- func (h *PostgreSQLDBDriver) FindGPGKeyByValue(value string, pageStart, pageEnd int) ([]models.GPGKey, error)
- func (h *PostgreSQLDBDriver) FinishCursor() error
- func (h *PostgreSQLDBDriver) GetUser(username string) (um *models.User, err error)
- func (h *PostgreSQLDBDriver) GetUserToken(token string) (ut *models.UserToken, err error)
- func (h *PostgreSQLDBDriver) HealthCheck() error
- func (h *PostgreSQLDBDriver) InitCursor() error
- func (h *PostgreSQLDBDriver) InvalidateUserTokens() (int, error)
- func (h *PostgreSQLDBDriver) NextGPGKey(key *models.GPGKey) bool
- func (h *PostgreSQLDBDriver) NextUser(user *models.User) bool
- func (h *PostgreSQLDBDriver) NumGPGKeys() (int, error)
- func (h *PostgreSQLDBDriver) RemoveUserToken(token string) (err error)
- func (h *PostgreSQLDBDriver) UpdateGPGKey(key models.GPGKey) (err error)
- func (h *PostgreSQLDBDriver) UpdateUser(um models.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgreSQLDBDriver ¶
type PostgreSQLDBDriver struct {
// contains filtered or unexported fields
}
PostgreSQLDBDriver is a database driver for PostgreSQL
func MakePostgreSQLDBDriver ¶
func MakePostgreSQLDBDriver(log slog.Instance) *PostgreSQLDBDriver
MakeRethinkDBDriver creates a new database driver for rethinkdb
func (*PostgreSQLDBDriver) AddGPGKey ¶
AddGPGKey adds a GPG Key to the database or update an existing one by fingerprint Returns generated id / hasBeenAdded / error
func (*PostgreSQLDBDriver) AddGPGKeys ¶
func (h *PostgreSQLDBDriver) 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 (*PostgreSQLDBDriver) AddUser ¶
func (h *PostgreSQLDBDriver) AddUser(um models.User) (string, error)
AddUser adds a user in the database if not exists
func (*PostgreSQLDBDriver) AddUserToken ¶
func (h *PostgreSQLDBDriver) AddUserToken(ut models.UserToken) (string, error)
func (*PostgreSQLDBDriver) Connect ¶
func (h *PostgreSQLDBDriver) Connect(connectionString string) error
func (*PostgreSQLDBDriver) DeleteGPGKey ¶
func (h *PostgreSQLDBDriver) DeleteGPGKey(key models.GPGKey) error
DeleteGPGKey deletes the specified GPG key by using it's ID
func (*PostgreSQLDBDriver) FetchGPGKeyByFingerprint ¶
func (h *PostgreSQLDBDriver) FetchGPGKeyByFingerprint(fingerprint string) (*models.GPGKey, error)
FetchGPGKeyByFingerprint fetch a GPG Key by its fingerprint
func (*PostgreSQLDBDriver) FetchGPGKeysWithoutSubKeys ¶
func (h *PostgreSQLDBDriver) FetchGPGKeysWithoutSubKeys() (res []models.GPGKey, err error)
FetchGPGKeysWithoutSubKeys fetch all keys that does not have a subkey This query is not implemented on PostgreSQL
func (*PostgreSQLDBDriver) FindGPGKeyByEmail ¶
func (h *PostgreSQLDBDriver) FindGPGKeyByEmail(email string, pageStart, pageEnd int) ([]models.GPGKey, error)
FindGPGKeyByEmail find all keys that has a underlying UID that contains that email
func (*PostgreSQLDBDriver) FindGPGKeyByFingerPrint ¶
func (h *PostgreSQLDBDriver) FindGPGKeyByFingerPrint(fingerPrint string, pageStart, pageEnd int) ([]models.GPGKey, error)
FindGPGKeyByFingerPrint find all keys that has a fingerprint that matches the specified fingerprint
func (*PostgreSQLDBDriver) FindGPGKeyByName ¶
func (h *PostgreSQLDBDriver) FindGPGKeyByName(name string, pageStart, pageEnd int) ([]models.GPGKey, error)
FindGPGKeyByName find all keys that has a underlying UID that contains that name
func (*PostgreSQLDBDriver) FindGPGKeyByValue ¶
func (h *PostgreSQLDBDriver) 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 (*PostgreSQLDBDriver) FinishCursor ¶
func (h *PostgreSQLDBDriver) FinishCursor() error
func (*PostgreSQLDBDriver) GetUser ¶
func (h *PostgreSQLDBDriver) GetUser(username string) (um *models.User, err error)
GetUser fetchs a user from the database by it's username
func (*PostgreSQLDBDriver) GetUserToken ¶
func (h *PostgreSQLDBDriver) GetUserToken(token string) (ut *models.UserToken, err error)
func (*PostgreSQLDBDriver) HealthCheck ¶
func (h *PostgreSQLDBDriver) HealthCheck() error
HealthCheck returns nil if everything is OK with the handler
func (*PostgreSQLDBDriver) InitCursor ¶
func (h *PostgreSQLDBDriver) InitCursor() error
func (*PostgreSQLDBDriver) InvalidateUserTokens ¶
func (h *PostgreSQLDBDriver) InvalidateUserTokens() (int, error)
func (*PostgreSQLDBDriver) NextGPGKey ¶
func (h *PostgreSQLDBDriver) NextGPGKey(key *models.GPGKey) bool
func (*PostgreSQLDBDriver) NumGPGKeys ¶
func (h *PostgreSQLDBDriver) NumGPGKeys() (int, error)
func (*PostgreSQLDBDriver) RemoveUserToken ¶
func (h *PostgreSQLDBDriver) RemoveUserToken(token string) (err error)
RemoveUserToken removes a user token from the database
func (*PostgreSQLDBDriver) UpdateGPGKey ¶
func (h *PostgreSQLDBDriver) UpdateGPGKey(key models.GPGKey) (err error)
UpdateGPGKey updates the specified GPG key by using it's ID
func (*PostgreSQLDBDriver) UpdateUser ¶
func (h *PostgreSQLDBDriver) UpdateUser(um models.User) error
UpdateUser updates user fingerprint, password and / or fullname by it's ID
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Code generated for package migrations by go-bindata DO NOT EDIT.
|
Code generated for package migrations by go-bindata DO NOT EDIT. |