Version: v0.0.0-...-151ce6e Latest Latest

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

Go to latest
Published: Dec 17, 2020 License: MIT Imports: 5 Imported by: 0




This section is empty.


This section is empty.


func PagePasswords

func PagePasswords(c echo.Context) error


type BasePassword

type BasePassword struct {
	Id          int64  `json:"id"`
	Provenance  string `json:"provenance"`
	Loggin      string `json:"loggin"`
	Description string `json:"description"`

type Controller

type Controller struct {
	DB *sql.DB

func (Controller) CreatePassword

func (ct Controller) CreatePassword(c echo.Context) error

func (Controller) DeletePassword

func (ct Controller) DeletePassword(c echo.Context) error

func (Controller) GetPasswords

func (ct Controller) GetPasswords(c echo.Context) error

func (Controller) UpdatePassword

func (ct Controller) UpdatePassword(c echo.Context) error

type DB

type DB interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	Query(query string, args ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...interface{}) *sql.Row
	Prepare(query string) (*sql.Stmt, error)

DB groups transaction like objects

type GetPasswordsOut

type GetPasswordsOut map[int64]PublicPassword

type Ids

type Ids []int64

type Password

type Password struct {
	PasswordCrypted []byte `json:"password_crypted,omitempty"`

func ScanPassword

func ScanPassword(row *sql.Row) (Password, error)

func SelectPassword

func SelectPassword(tx DB, id int64) (Password, error)

SelectPassword returns the entry matching id.

func (Password) Delete

func (item Password) Delete(tx DB) (Password, error)

Deletes Password in the database and returns the item. Only the field 'Id' is used.

func (Password) Insert

func (item Password) Insert(tx DB) (out Password, err error)

Insert Password in the database and returns the item with id filled.

func (Password) Publie

func (pa Password) Publie() (PublicPassword, error)

func (Password) Update

func (item Password) Update(tx DB) (out Password, err error)

Update Password in the database and returns the new version.

type Passwords

type Passwords map[int64]Password

func ScanPasswords

func ScanPasswords(rs *sql.Rows) (Passwords, error)

func SelectAllPasswords

func SelectAllPasswords(tx DB) (Passwords, error)

func (Passwords) Ids

func (m Passwords) Ids() Ids

func (Passwords) Publie

func (passs Passwords) Publie() (GetPasswordsOut, error)

type PublicPassword

type PublicPassword struct {
	Password string `json:"password"`

func (PublicPassword) Crypte

func (ppa PublicPassword) Crypte() (Password, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto