Documentation ¶
Index ¶
Constants ¶
View Source
const ( HTTPHeaderAccept = "Accept" HTTPHeaderContentType = "Content-Type" MIMETypeJSON = "application/json" MIMETypeJSONProblem = "application/problem+json" MIMETYPEFormURLEncoded = "application/x-www-form-urlencoded" MIMETypePlainText = "text/plain" MimeTypeEverything = "*/*" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(db db.Model) *Controller
func (*Controller) Index ¶
func (ctl *Controller) Index(w http.ResponseWriter, r *http.Request)
Just return 200, can be used as a Readiness probe
func (*Controller) RecordBirthday ¶
func (ctl *Controller) RecordBirthday(w http.ResponseWriter, r *http.Request)
RecordBirthday is a PUT endpoint that fetches the name and the birthday date and stores it in the database
func (*Controller) TellBirthday ¶
func (ctl *Controller) TellBirthday(w http.ResponseWriter, r *http.Request)
TellBirthday is a GET endpoint that returns the birthday of a person whose name is passed in the GET query string
type TypedError ¶
type TypedError struct {
// contains filtered or unexported fields
}
func NewTypedError ¶
func NewTypedError(kind ErrorType, message string) *TypedError
func (*TypedError) Error ¶
func (e *TypedError) Error() string
Click to show internal directories.
Click to hide internal directories.