store

package
v0.0.0-...-f85d8dc Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInput

func GetInput(argument string) string

GetInput receives user input in a streamlined fashion.

func GetPassInput

func GetPassInput(argument string) []byte

GetPassInput receives user's input securely, it makes use of the syscall library to achieve this

Types

type DBStore

type DBStore struct {
	Conn *sql.DB
	// contains filtered or unexported fields
}

func NewDBStore

func NewDBStore() (*DBStore, error)

func (*DBStore) DeleteCreds

func (db *DBStore) DeleteCreds(key string, encryptionKey []byte) error

func (*DBStore) EditCreds

func (db *DBStore) EditCreds(key string, encryptionKey []byte) error

func (*DBStore) InsertIntoDB

func (db *DBStore) InsertIntoDB(encryptedPassword string, creds map[string]string) error

func (*DBStore) RetrieveCreds

func (db *DBStore) RetrieveCreds(query, key string, encryptionKey []byte) ([]map[string]string, error)

RetrieveCreds retrieves userdata from the database given respective query

func (*DBStore) SaveCreds

func (db *DBStore) SaveCreds(encryptionKey []byte) error

SaveCreds saves the user-entered credentials to the database

func (*DBStore) ViewCreds

func (db *DBStore) ViewCreds(key string, encryptionKey []byte) error

type Store

type Store interface {
	SaveCreds([]byte) error

	RetrieveCreds(string, string, []byte) ([]map[string]string, error)

	ViewCreds(string, []byte) error

	EditCreds(string, []byte) error

	DeleteCreds(string, []byte) error
}

Jump to

Keyboard shortcuts

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