backend

package
v0.0.0-...-aa47473 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Backend orchestrates all database actions

Index

Constants

This section is empty.

Variables

View Source
var DeletedMoreRowsThenExpected = errors.New("Query deleted more rows then expected.")
View Source
var EmptyMasterPassword = errors.New("No master passwrod given to compare.")
View Source
var EmptyPassword = errors.New("No password given to insert.")
View Source
var EmptyServiceName = errors.New("No service name given to insert.")
View Source
var EmptyUsername = errors.New("No username name given to insert.")
View Source
var MasterPasswordDoNotMatch = errors.New("Provided master password do not match database.")
View Source
var NoRowsDeleted = errors.New("Query did not delete any rows.")
View Source
var ServiceNameAlreadyTaken = errors.New("Provided service name is already present in database.")
View Source
var ServiceNameNotFound = errors.New("Provided service name is not present in database.")

Functions

func InitGCM

func InitGCM(secretKey []byte) (cipher.AEAD, error)

Returns GCM block cipher based on secret key

Types

type ArgonConfig

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

func GetDefaultArgonConfig

func GetDefaultArgonConfig() ArgonConfig

type Backend

type Backend struct {
	DB *sql.DB
}

func Initialize

func Initialize(applicationDB string) (*Backend, error)

Opens connection to the sqlite local database

func (*Backend) CmpMasterPassword

func (backend *Backend) CmpMasterPassword(masterPasswordGUI string) (bool, error)

func (*Backend) CountMasterEntries

func (backend *Backend) CountMasterEntries() (int, error)

func (*Backend) CountServiceNameOccurences

func (backend *Backend) CountServiceNameOccurences(serviceName string) (int, error)

func (*Backend) CreateStructure

func (backend *Backend) CreateStructure() error

Create db from schema

func (*Backend) DecryptPasswordEntry

func (backend *Backend) DecryptPasswordEntry(serviceName string, masterPasswordGUI string) (PasswordEntry, error)

Finds and decrypts password and username for given service name

func (*Backend) DeletePasswordEntry

func (backend *Backend) DeletePasswordEntry(serviceName string) error

func (*Backend) EncryptPasswordEntry

func (backend *Backend) EncryptPasswordEntry(serviceName string, password string, username string, masterPasswordGUI string) error

Inserts encrypted password and username for given service name

func (*Backend) GetPasswordEntriesList

func (backend *Backend) GetPasswordEntriesList() ([]string, error)

func (*Backend) GetUserSecretKey

func (backend *Backend) GetUserSecretKey(masterPasswordGUI string) ([]byte, error)

func (*Backend) InitMaster

func (backend *Backend) InitMaster(masterPassword string) error

Create all necessary crypto primitives and insert them with master password to db

type PasswordEntry

type PasswordEntry struct {
	Username    string
	Password    string
	ServiceName string
}

Jump to

Keyboard shortcuts

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