models

package
v0.0.0-...-57ee888 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2014 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DATABASE *mgo.Database = nil
)

Functions

func InjectDatabase

func InjectDatabase(db *mgo.Database)

Types

type GithubOAuth

type GithubOAuth struct {
	Token   string    `form:"-" bson:"tk,omitempty"`
	Code    string    `form:"code" bson:"c,omitempty"`
	State   string    `form:"state" binding:"required" bson:"s"`
	Timeout time.Time `form:"-" bson:"t"`
}

the model for a basic Github OAuth response

func (*GithubOAuth) Validate

func (oauth *GithubOAuth) Validate(errors *binding.Errors, req *http.Request)

validate the OAuth response

type User

type User struct {
	Id          int64     `form:"-" json:"id"`
	Name        string    `form:"name" json:"name" binding:"required"`
	Email       string    `form:"email" json:"email" binding:"required"`
	Password    string    `form:"password" json:"password" binding:"required"`
	Location    string    `form:"location" json:"location"`
	Created     time.Time `form:"-" json:"created"`
	Updated     time.Time `form:"-" json:"updated"`
	CreatedWith string    `form:"createdWith" json:"createdWith" binding:"required"`

	GithubId    int64 `form:"githubId" json:"githubId"`
	BitbucketId int64 `form:"bitbucketId" json:"bitbucketId"`
	LinkedinId  int64 `form:"linkedinId" json:"linkedinId"`
}

the model for a basic User

func (*User) PullProfile

func (user *User) PullProfile(error)

pull profile information

func (*User) ToJson

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

func (*User) Validate

func (user *User) Validate(errors *binding.Errors, req *http.Request)

validate the user record

Jump to

Keyboard shortcuts

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