user

package
v0.0.0-...-ceb20fc Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorization

func Authorization(handler http.Handler) http.Handler

func Register

func Register(w http.ResponseWriter, r *http.Request)

func Token

func Token(w http.ResponseWriter, r *http.Request)

Types

type User

type User struct {
	gorm.Model `json:"-"`
	Email      string `gorm:"type:varchar(100);unique_index"`
	Name       string `gorm:"unique;not null"`
	Password   string `json:"-",gorm:"not null"`
}

func (*User) CheckToken

func (user *User) CheckToken(token string) bool

func (*User) Insert

func (user *User) Insert() error

func (*User) Login

func (user *User) Login(email string, password string) bool

func (*User) Token

func (user *User) Token() (string, error)

Jump to

Keyboard shortcuts

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