user

package
v0.0.0-...-cbaa3f3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Update

func Update(db *gorp.DbMap, u User) error

Types

type AuthProvider

type AuthProvider struct {
	UId  int64
	Sn   string
	SnId string
}

func IsUserFromSocialNetwork

func IsUserFromSocialNetwork(db *gorp.DbMap, sn string, user string) (AuthProvider, error)

type SmsSender

type SmsSender interface {
	Send(to string, message string) error
}

type User

type User struct {
	Id   int64
	Uuid string

	FirstName  string
	LastName   string
	Patronymic string
	Sex        int64

	NickName string
	Photo    int64

	Phone   string
	Email   string
	Address string

	Registered     bool   `json:"-"`
	HashedPassword []byte `json:"-"`

	Permission int64
	Created    int64
	Updated    int64
	Deleted    int64
	Version    int64
}

func CheckPhone

func CheckPhone(db *gorp.DbMap, phone string) (User, error)

func Get

func Get(db *gorp.DbMap, id int64) (User, error)

func GetAllUsers

func GetAllUsers(db *gorp.DbMap, offset, limit int64) ([]User, error)

func GetByUuid

func GetByUuid(db *gorp.DbMap, uuid string) (*User, error)

func GetUsers

func GetUsers(db *gorp.DbMap, ids []int64) ([]User, error)

func (*User) CheckLogin

func (u *User) CheckLogin(db *gorp.DbMap, login string) (User, error)

func (*User) Confirm

func (u *User) Confirm(db *gorp.DbMap, code int64, userid int64) error

func (*User) NewPassword

func (u *User) NewPassword(db *gorp.DbMap, password string) error

func (*User) Restore

func (u *User) Restore(db *gorp.DbMap, s SmsSender,
	login string) (UserConfirmation, error)

func (*User) SignIn

func (u *User) SignIn(db *gorp.DbMap, password, login string) (*User, error)

func (*User) SignUp

func (u *User) SignUp(db *gorp.DbMap, s SmsSender, firstname, lastname, phone,
	password string) error

func (User) String

func (u User) String() string

type UserConfirmation

type UserConfirmation struct {
	Id     int64
	UserId int64
	Code   int64
	Tried  bool

	Created int64
}

Jump to

Keyboard shortcuts

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