httputil

package
v0.0.0-...-5163f5a Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance interface {
	Start() error
	ShutDown() error
}

func NewInstance

func NewInstance(server *http.Server) Instance

type Response

type Response struct {
	Data   interface{} `json:"data"`
	Errors []string    `json:"errors"`

	ProcessTime float64 `json:"process_time"`
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse() Response

func (*Response) ToJSON

func (r *Response) ToJSON() []byte

func (*Response) WriteError

func (r *Response) WriteError(w http.ResponseWriter, httpStatus int, errors []string)

func (*Response) WriteOK

func (r *Response) WriteOK(w http.ResponseWriter, data interface{})

Jump to

Keyboard shortcuts

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