rating

package
v0.0.0-...-8d3ea40 Latest Latest
Warning

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

Go to latest
Published: May 17, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentTime

func CurrentTime() int64

func CurrentTimeStr

func CurrentTimeStr() string

func LoadJSON

func LoadJSON(file string, v interface{}) error

Types

type Api

type Api struct {
	rest.Api
	Conf           *ApiConf
	PKeyMiddleware *PKeyMiddleware
	Session        *mgo.Session
	Database       *mgo.Database
	Ratings        *mgo.Collection
}

func NewApi

func NewApi(conf *ApiConf) *Api

func (*Api) GetAll

func (api *Api) GetAll(w rest.ResponseWriter, r *rest.Request)

func (*Api) Save

func (api *Api) Save(w rest.ResponseWriter, r *rest.Request)

type ApiConf

type ApiConf struct {
	ApiKey string
	Env    string
	Host   ApiHostConf
	DB     ApiDBConf
}

func DevConf

func DevConf() *ApiConf

type ApiDBConf

type ApiDBConf struct {
	Host string
	Name string
	Col  string
	Drop bool
}

type ApiHostConf

type ApiHostConf struct {
	Addr string
	Port string
}

type PKeyMiddleware

type PKeyMiddleware struct {
	PKey string
}

func NewPKeyMiddleware

func NewPKeyMiddleware(pkey string) *PKeyMiddleware

func (*PKeyMiddleware) BuildKey

func (pkm *PKeyMiddleware) BuildKey(pkey string, ts string) []byte

func (*PKeyMiddleware) MiddlewareFunc

func (pkm *PKeyMiddleware) MiddlewareFunc(h rest.HandlerFunc) rest.HandlerFunc

type Rating

type Rating struct {
	ID       bson.ObjectId `bson:"_id,omitempty"`
	Tenant   string
	Category string
	ItemId   string
	Rating   uint
	RatingOn uint
}

Jump to

Keyboard shortcuts

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