models

package
v0.0.0-...-8721b20 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2014 License: GPL-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BasicPageArrayIncr = 5
)

Variables

View Source
var (
	ErrInvalidLoginPassword = errors.New("The username or password you entered is not valid")
	ErrUserNotFound         = errors.New("User not found")
	ErrUserSave             = errors.New("Error occured when saving user changes")
	ErrUserPasswordSave     = errors.New("Error occured when saving password modification")
)

Functions

This section is empty.

Types

type BasicPage

type BasicPage struct {
	Title    string
	Info     []string
	Warnings []string
	Errors   []string
	Debug    []string
}

func (*BasicPage) AddDebug

func (p *BasicPage) AddDebug(item string)

func (*BasicPage) AddError

func (p *BasicPage) AddError(item string)

func (*BasicPage) AddInfo

func (p *BasicPage) AddInfo(item string)

func (*BasicPage) AddWarning

func (p *BasicPage) AddWarning(item string)

func (*BasicPage) Init

func (p *BasicPage) Init(title string)

type BasicUser

type BasicUser struct {
	Id    string
	Login string
	Email string
}

func (*BasicUser) Authentificate

func (u *BasicUser) Authentificate(password string) error

func (*BasicUser) ChangePassword

func (u *BasicUser) ChangePassword(password string) error

func (*BasicUser) Create

func (u *BasicUser) Create(password string) error

func (*BasicUser) GetById

func (u *BasicUser) GetById() error

func (*BasicUser) GetByLogin

func (u *BasicUser) GetByLogin() error

func (*BasicUser) Save

func (u *BasicUser) Save() error

type UserDB

type UserDB struct {
	Id                bson.ObjectId `bson:"_id,omitempty" json:"-"`
	Login             string        `bson:"login" json:"login"`
	Email             string        `bson:"email" json:"email"`
	EncryptedPassword []byte        `bson:"encrypted_password" json:"encrypted_password"`
	Salt              []byte        `bson:"salt" json:"salt"`
	CreatedAt         time.Time     `bson:"created_at" json:"-"`
	UpdatedAt         time.Time     `bson:"updated_at" json:"-"`
}

type UserPage

type UserPage struct {
	BasicPage
	User     BasicUser
	IsLogged bool
}

Jump to

Keyboard shortcuts

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