http

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 19, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePagination

func ParsePagination(defaultLimit int) func(r *http.Request) (*flare.Pagination, error)

ParsePagination extract the pagination from http.Request.

func WriteResponse

func WriteResponse(logger log.Logger) func(http.ResponseWriter, interface{}, int, http.Header)

WriteResponse is used to write the response on http.ResponseWriter.

Types

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer is used to send the content to the client.

func NewWriter

func NewWriter(logger log.Logger) (*Writer, error)

NewWriter returns a configured writer.

func (*Writer) Error

func (wrt *Writer) Error(w http.ResponseWriter, title string, err error, status int)

Error is used to generate a proper error content to be sent to the client.

func (*Writer) Response

func (wrt *Writer) Response(w http.ResponseWriter, r interface{}, status int, headers http.Header)

Response is used write response on http.ResponseWriter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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