model

package
v0.0.0-...-28e46bb Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2013 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPHandlerFunc

func HTTPHandlerFunc(f func(HTTPContext) error) http.Handler

func JSONHandlerFunc

func JSONHandlerFunc(f func(JSONContext) (jsoncontext.Resp, error)) http.Handler

Types

type Context

type Context interface {
	User() *User
	ClientId() string
	Version() int64
	Save() error
	Session() *sessions.Session
}

type DefaultContext

type DefaultContext struct {
	HTTPContext httpcontext.HTTPContext
	// contains filtered or unexported fields
}

func NewContext

func NewContext(httpContext httpcontext.HTTPContext) (result *DefaultContext, err error)

func (*DefaultContext) ClientId

func (self *DefaultContext) ClientId() string

func (*DefaultContext) Save

func (self *DefaultContext) Save() error

func (*DefaultContext) Session

func (self *DefaultContext) Session() *sessions.Session

func (*DefaultContext) User

func (self *DefaultContext) User() *User

func (*DefaultContext) Version

func (self *DefaultContext) Version() int64

type DefaultHTTPContext

type DefaultHTTPContext struct {
	gaecontext.HTTPContext
	Context
}

type DefaultJSONContext

type DefaultJSONContext struct {
	gaecontext.JSONContext
	Context
}

type HTTPContext

type HTTPContext interface {
	gaecontext.HTTPContext
	Context
}

type JSONContext

type JSONContext interface {
	gaecontext.JSONContext
	Context
}

type Project

type Project struct {
	Id           *datastore.Key `datastore:"-"`
	UserId       int
	Name         string   `update_scopes:"basic"`
	Repositories []string `update_scopes:"basic"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func GetProjectById

func GetProjectById(c HTTPContext, id *datastore.Key) (result *Project, err error)

func (*Project) Delete

func (self *Project) Delete(c HTTPContext) (err error)

func (*Project) Save

func (self *Project) Save(c HTTPContext) (err error)

type Projects

type Projects []Project

func GetProjectsByUserId

func GetProjectsByUserId(c HTTPContext) (result Projects, err error)

func (Projects) Len

func (self Projects) Len() int

func (Projects) Less

func (self Projects) Less(i, j int) bool

func (Projects) Swap

func (self Projects) Swap(i, j int)

type User

type User struct {
	AccessToken string `json:"access_token"`
	AvatarUrl   string `json:"avatar_url"`
	Login       string `json:"login"`
	Id          int    `json:"id"`
}

func (*User) Load

func (self *User) Load(c gaecontext.GAEContext) (err error)

Jump to

Keyboard shortcuts

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