user

package
v0.0.0-...-cfce1d4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Pepper for user authentication
	Pepper = `AAUIAbhABJb*&!^^@$%^6756nVBZZVBvnGHVAjhM<PE($#^$&())NnwpiwnOW?"|">?UwoUWBK`
)

Variables

This section is empty.

Functions

func Delete

func Delete(ctx *authcontext.Context, email string) error

Delete an user based on its email.

Types

type Basic

type Basic struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

Basic defines basic user attributes

func Create

func Create(ctx *authcontext.Context, usr *Full) (*Basic, error)

Create an user

func GetByEmail

func GetByEmail(ctx *authcontext.Context, email string) (*Basic, error)

GetByEmail an user based on its Email

func GetUsers

func GetUsers(ctx *authcontext.Context) ([]Basic, error)

GetUsers Fetches all users

func Update

func Update(ctx *authcontext.Context, usr *Full) (*Basic, error)

Update user data

type Full

type Full struct {
	Name         string `json:"name" binding:"required"`
	Email        string `json:"email" binding:"required"`
	Password     string `json:"password"`
	Role         int    `json:"role"`
	CreationTime int64  `json:"creationTime"`
	UpdateTime   int64  `json:"updateTime"`
}

Full defines full user attributes

func GetFullByEmail

func GetFullByEmail(ctx *authcontext.Context, email string) (*Full, error)

GetFullByEmail full User info based on its email

Jump to

Keyboard shortcuts

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