auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2018 License: GPL-3.0, GPL-3.0-or-later Imports: 2 Imported by: 0

Documentation

Overview

Package auth implement Account model used for authentication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID       bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"`
	Username string        `json:"username" bson:"username"`
	Email    string        `json:"email" bson:"email"`
	Password string        `json:"password,omitempty" bson:"password"`
}

Account contains account login data.

func (*Account) ComparePassword

func (a *Account) ComparePassword(password string) bool

ComparePassword return true, if argument hash is equals to a.Password.

func (*Account) GeneratePassword

func (a *Account) GeneratePassword() error

GeneratePassword encrypt a.Password using bcrypt algorithm.

Jump to

Keyboard shortcuts

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