users

package
Version: v0.0.0-...-9e745d5 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(client *postgres.PGClient) subset.User

New - return inretface user

Types

type User

type User struct {
	ID       int64    `json:id`
	User     string   `json:user`
	Password string   `json:password,omitempty`
	Role     string   `json:"role"`
	Projects []string `json:"projects"`
	DBClient *postgres.PGClient
	jwt.StandardClaims
}

User - struct for user, contains username, passowd (in base64) and JWT

func (User) ChangePassword

func (u User) ChangePassword() error

ChangePassword - change user password

func (User) CheckPasswordExp

func (u User) CheckPasswordExp() (res bool, err error)

CheckPasswordExp - func for check PasswordExp (for )validation of user token)

func (User) CheckUser

func (u User) CheckUser() (res bool, err error)

CheckUser - func for check users (for )validation of user token)

func (User) Create

func (u User) Create() error

Create - create new user and insert data to database

func (User) Delete

func (u User) Delete() error

Delete -delete user

func (User) NewTokenString

func (u User) NewTokenString(temp bool) (token string, err error)

NewTokenString - func for generate and response new token

func (User) Update

func (u User) Update() error

Update - update user data

Source Files

Jump to

Keyboard shortcuts

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