data

package
v0.0.0-...-21cab16 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encrypt

func Encrypt(plaintext string) (cryptext string)

hash plaintext with SHA-1

Types

type Session

type Session struct {
	Id        int
	Uuid      string
	Email     string
	UserId    int
	CreatedAt time.Time
}

func (*Session) Check

func (session *Session) Check() (ok bool, err error)

func (*Session) Remove

func (sess *Session) Remove()

type User

type User struct {
	Id        int
	Uuid      string
	Name      string
	StudentID string

	Email    string
	Password string

	IsAdmin bool
	Coin    int

	CreatedAt time.Time
}

func ListUsers

func ListUsers(orderBy string) (users []User, err error)

func UserByEmail

func UserByEmail(email string) (user User, err error)

func (*User) ChargeCoin

func (user *User) ChargeCoin(n int) (err error)

func (*User) Create

func (user *User) Create() (err error)

func (*User) CreateSession

func (user *User) CreateSession() (session Session, err error)

func (*User) SetAdmin

func (user *User) SetAdmin() (err error)

func (*User) SetCoin

func (user *User) SetCoin(n int) (err error)

Jump to

Keyboard shortcuts

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