http

package
v0.0.0-...-9b02830 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Created

func Created(c *routing.Context, msg string, service string) error

Created Creates and sends created response

func Deleted

func Deleted(c *routing.Context, msg string, service string) error

Deleted creates and send deleted response

func Error

func Error(c *routing.Context, err string, statusCode int, service string) error

Error creates and sends error response

func GetHeadersFromRequest

func GetHeadersFromRequest(request fasthttp.Request) map[string]string

func GetQueryParamsFromRequest

func GetQueryParamsFromRequest(c *routing.Context) map[string]string

func GetQueryParamsFromRequestCtx

func GetQueryParamsFromRequestCtx(c *fasthttp.RequestCtx) map[string]string

func GetURIWithParams

func GetURIWithParams(c *routing.Context) string

func MakeRequest

func MakeRequest(method string, url string, body string, headers map[string]string) *fasthttp.Response

func NotAuthorized

func NotAuthorized(c *routing.Context, service string) error

func NotFound

func NotFound(c *routing.Context, msg string, service string) error

NotFound creates and send not found response

func Ok

func Ok(c *routing.Context, msg string, service string) error

Ok creates and send created response

func OkFormated

func OkFormated(c *routing.Context, msg string, service string) error

OkFormated creates and send created response

func ParsePageParam

func ParsePageParam(c *routing.Context) (int, error)

ParsePageParam parses page query parameter

func Response

func Response(c *routing.Context, response string, statuscode int, service string, contentType string)

Response creates the API response structure

Types

type ResponseInfo

type ResponseInfo struct {
	StatusCode  int
	ContentType []byte
	Body        []byte
}

Jump to

Keyboard shortcuts

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