models

package
v0.0.0-...-1fbe2b1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

https://gist.github.com/stupidbodo/ thanks for this lib

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDB

func ConnectDB() *sql.DB

func Decrypt

func Decrypt(key []byte, text string) (string, error)

func Encrypt

func Encrypt(key []byte, text string) (string, error)

func Hash

func Hash(text string) string

Hashing

func NewKey

func NewKey(badge string, password string) string

func NewUser

func NewUser(db *sql.DB, u User)

INSERIRE un NUOVO utente

func NewVault

func NewVault(db *sql.DB, username string, key string, account string, password string)

func Pad

func Pad(src []byte) []byte

func Try

func Try(e error)

func Unpad

func Unpad(src []byte) ([]byte, error)

Types

type User

type User struct {
	Username string
	Password string
	Email    string
}

func SelectUser

func SelectUser(db *sql.DB, username string) (*User, error)

SELECT di uno specifico UTENTE

type Vault

type Vault struct {
	Id       int
	Account  string
	Password string
}

func GetVault

func GetVault(db *sql.DB, username string, key string) []Vault

Jump to

Keyboard shortcuts

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