http

package
v0.0.0-...-6496225 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MethodNotAllowed

func MethodNotAllowed(ctx *fasthttp.RequestCtx)

func NotFound

func NotFound(ctx *fasthttp.RequestCtx)

func PanicHandler

func PanicHandler(ctx *fasthttp.RequestCtx, rcv interface{})

func SetRestError

func SetRestError(ctx *fasthttp.RequestCtx, err error, errCode int)

Types

type HttpRouter

type HttpRouter struct {
	fasthttprouter.Router
}

type HttpServer

type HttpServer struct {
	net.Listener
	fasthttp.Server
	// contains filtered or unexported fields
}

func NewHttpServer

func NewHttpServer(routing *HttpRouter, logger log.Logger, params map[string]interface{}) (*HttpServer, error)

func (*HttpServer) Start

func (h *HttpServer) Start(quitSignal <-chan bool) error

func (*HttpServer) Stop

func (h *HttpServer) Stop() error

type RestError

type RestError struct {
	Method      string        `json:"method,omitempty"`
	ErrorString string        `json:"errorString,omitempty"`
	ErrorCode   int           `json:"errorCode"`
	Arguments   RestErrorArgs `json:"arguments,omitempty"`
}

type RestErrorArg

type RestErrorArg struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

type RestErrorArgs

type RestErrorArgs struct {
	Query string         `json:"query,omitempty"`
	Keys  []RestErrorArg `json:"keys,omitempty"`
}

Jump to

Keyboard shortcuts

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