user

package
v0.0.0-...-70589ec Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(hash, password string) error

func CryptPass

func CryptPass(pass string) string

Types

type User

type User struct {
	UUID      string    `json:"uuid" xorm:"'uuid' pk"`
	Username  string    `json:"username" xorm:"unique"`
	Password  string    `json:"-"`
	CreatedAt time.Time `xorm:"created" json:"created_at"`
	UpdatedAt time.Time `xorm:"updated" json:"updated_at"`
}

User db model

func NewEncryptedUser

func NewEncryptedUser(username, password string) (u *User)

NewEncryptedUser Entity

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(connStr string) *UserService

func (*UserService) AuthUser

func (us *UserService) AuthUser(username, password string) (b bool)

func (*UserService) SaveUser

func (us *UserService) SaveUser(username, password string) (err error)

func (*UserService) UpdatePassword

func (us *UserService) UpdatePassword(userName, oldPassword, newPassword string) (success bool)

Jump to

Keyboard shortcuts

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