Created
October 30, 2016 21:36
-
-
Save akutz/db765d71327f5d415ce6fcfa748a2d1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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