httpserver

package
v0.0.0-...-59ffee2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package httpserver http errors CODE GENERATED AUTOMATICALLY THIS FILE COULD BE EDITED BY HANDS

Package httpserver http handler CODE GENERATED AUTOMATICALLY THIS FILE COULD BE EDITED BY HANDS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeFastHTTPRouter

func MakeFastHTTPRouter(handlerSettings []*HandlerSettings) *fasthttprouter.Router

MakeFastHTTPRouter ...

func NewError

func NewError(status int, format string, v ...interface{}) error

NewError ...

Types

type ErrorBody

type ErrorBody struct {
	Data      string `json:"data"`
	Error     bool   `json:"error"`
	ErrorText string `json:"errorText"`
}

ErrorBody ...

func (ErrorBody) MarshalEasyJSON

func (v ErrorBody) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ErrorBody) MarshalJSON

func (v ErrorBody) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ErrorBody) UnmarshalEasyJSON

func (v *ErrorBody) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ErrorBody) UnmarshalJSON

func (v *ErrorBody) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ErrorProcessor

type ErrorProcessor interface {
	Encode(ctx context.Context, r *fasthttp.Response, err error)
	Decode(r *fasthttp.Response) error
}

ErrorProcessor ...

func NewErrorProcessor

func NewErrorProcessor(defaultCode int, defaultMessage string) ErrorProcessor

NewErrorProcessor ...

type HandlerSettings

type HandlerSettings struct {
	Path    string
	Method  string
	Handler fasthttp.RequestHandler
}

HandlerSettings ...

Jump to

Keyboard shortcuts

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