server

package
v0.0.0-...-ecb58e0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: MIT Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrUserNotFound .
	ErrUserNotFound = errors.New("user not found")
	// ErrPasswordNotFound .
	ErrPasswordNotFound = errors.New("password not found")
)

Functions

func CreateUser

func CreateUser(email, passord string) error

CreateUser .

func DeletePasswordByIDAndUserID

func DeletePasswordByIDAndUserID(id, userID string) error

DeletePasswordByIDAndUserID .

func Start

func Start(dbPath, host string, port int, disableRegistration bool)

Start .

Types

type PasswordModel

type PasswordModel struct {
	ID        string `json:"id"`
	UserID    string `json:"-"`
	Login     string `json:"login"`
	Site      string `json:"site"`
	Uppercase bool   `json:"uppercase"`
	Symbols   bool   `json:"symbols"`
	Lowercase bool   `json:"lowercase"`
	Numbers   bool   `json:"numbers"`
	Counter   int    `json:"counter"`
	Version   int    `json:"version"`
	Length    int    `json:"length"`
}

PasswordModel .

func CreatePassword

func CreatePassword(userID, login, site string, up, low, sym, num bool, c, v, l int) (*PasswordModel, error)

CreatePassword .

func GetPasswordByID

func GetPasswordByID(id string) (*PasswordModel, error)

GetPasswordByID .

func GetPasswordsByUserID

func GetPasswordsByUserID(userID string) []PasswordModel

GetPasswordsByUserID .

func (*PasswordModel) Update

func (p *PasswordModel) Update() error

Update .

type UserModel

type UserModel struct {
	ID       string    `json:"id"`
	Email    string    `json:"email"`
	Created  time.Time `json:"created"`
	Modified time.Time `json:"modified"`
}

UserModel .

func AuthUser

func AuthUser(email, password string) (*UserModel, error)

AuthUser .

func GetUserByID

func GetUserByID(id string) (*UserModel, error)

GetUserByID .

Jump to

Keyboard shortcuts

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