models

package
v0.0.0-...-4206a4c Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AccountNotFound = errors.New("account not found")
)

Functions

func CreateAccount

func CreateAccount(db *mgo.Database, a Account) error

Types

type Account

type Account struct {
	AccountID string `json:"-" bson:"account_id"`
	Username  string `json:"username" bson:"username"`
	Password  string `json:"-" bson:"-"`
	Hashword  string `json:"-" bson:"password"`
	SessionID string `json:"-" bson:"session_id"`
}

func CheckSession

func CheckSession(db *mgo.Database, sessionID string) (Account, error)

func LoadAccount

func LoadAccount(db *mgo.Database, username string) (Account, error)

func (Account) ClearSession

func (a Account) ClearSession(db *mgo.Database) error

func (Account) NewSession

func (a Account) NewSession(db *mgo.Database) (string, error)

type TestStruct

type TestStruct struct {
	Name string
}

Jump to

Keyboard shortcuts

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