handler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEntry

func CreateEntry(s *mgo.Session) func(w http.ResponseWriter, r *http.Request)

CreateEntry makes a new Entry

func DeleteEntry

func DeleteEntry(s *mgo.Session) func(w http.ResponseWriter, r *http.Request)

DeleteEntry removes a entry a row from db

func ErrorWithJSON

func ErrorWithJSON(w http.ResponseWriter, message string, code int)

ErrorWithJSON represents errors in JSON for HTTP response

func GetEntries

func GetEntries(s *mgo.Session) func(w http.ResponseWriter, r *http.Request)

GetEntries fetches all the Entry stored TODO: Needs to throttle the count.

func GetEntry

func GetEntry(s *mgo.Session) func(w http.ResponseWriter, r *http.Request)

GetEntry fetches a single Entry given it's ID

func ResponseWithJSON

func ResponseWithJSON(w http.ResponseWriter, json []byte, code int)

ResponseWithJSON returns HTTP response in JSON

func UpdateEntry

func UpdateEntry(s *mgo.Session) func(w http.ResponseWriter, r *http.Request)

UpdateEntry updates data in mongodb for specific ID

Types

This section is empty.

Jump to

Keyboard shortcuts

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