Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { PutTree(*objects.Tree) (string, error) GetTree(string) (*objects.Tree, error) ListTrees(*ListOpts) ([]*objects.Tree, error) UpdateTree(*objects.Tree) error DeleteTree(string) error }
DB represents the storage needs of a harvest games' manager
type ListOpts ¶
type ListOpts struct { RadiusMeters int `json:"radius,omitempty"` Location *objects.Location `json:"location,omitempty"` TaggedBy []string `json:"tagged_by,omitempty"` Species []string `json:"species,omitempty"` }
ListOpts represents applicable filters when querying the db for a list of trees
type Memory ¶
Memory implements the Store interface in-memory (mock)
func (*Memory) DeleteTree ¶
DeleteTree deletes a tree from the store
type Mongo ¶
type Mongo struct {
// contains filtered or unexported fields
}
Mongo implements the DB interface in mongodb
func NewMongo ¶
NewMongo is the constructor for a Mongo type Store
the format of the mongo connection string is: mongodb://<user>:<pass>@<url>:<port>/<dbname>
func (*Mongo) DeleteTree ¶
DeleteTree deletes a tree from the db
func (*Mongo) ListTrees ¶
ListTrees gets a list of trees from the db note: opts must be validated before passing it this function
Click to show internal directories.
Click to hide internal directories.