endpoints

package
v0.0.0-...-5d63be7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrRender

func ErrRender(err error) render.Renderer

ErrRender renders an err

func NextCard

func NextCard(w http.ResponseWriter, r *http.Request)

NextCard is a handler to get the next card

Types

type CardResponse

type CardResponse struct {
	*flashcards.Card
}

CardResponse is a caard

func NewCardResponse

func NewCardResponse(Card *flashcards.Card) *CardResponse

NewCardResponse is a new card response

func (*CardResponse) Render

func (rd *CardResponse) Render(w http.ResponseWriter, r *http.Request) error

Render renders the cardresponse

type ErrResponse

type ErrResponse struct {
	Err            error `json:"-"` // low-level runtime error
	HTTPStatusCode int   `json:"-"` // http response status code

	StatusText string `json:"status"`          // user-level status message
	AppCode    int64  `json:"code,omitempty"`  // application-specific error code
	ErrorText  string `json:"error,omitempty"` // application-level error message, for debugging
}

ErrResponse is a an error response

func (*ErrResponse) Render

func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error

Render renders the error

Jump to

Keyboard shortcuts

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