Skip to content

Instantly share code, notes, and snippets.

@akutz
Created October 30, 2016 21:36
Show Gist options
  • Save akutz/db765d71327f5d415ce6fcfa748a2d1c to your computer and use it in GitHub Desktop.
Save akutz/db765d71327f5d415ce6fcfa748a2d1c to your computer and use it in GitHub Desktop.
package models
import "gopkg.in/mgo.v2/bson"
// Beer represents the structure of the resource
type Beer struct {
Id bson.ObjectId `json:"id" bson:"_id"`
Name string `json:"name" bson:"name"`
Type string `json:"type" bson:"type"`
ABV float64 `json:"ABV" bson:"ABV"`
Cost float64 `json:"cost" bson:"cost"`
}
)
// BeerController represents the controller for operating on the Beer resource
type BeerController struct{
session *mgo.Session
)
func NewBeerController(s *mgo.Session) *BeerController {
return &BeerController{s}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment