rest

package
v0.0.0-...-769edfc Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableCors

func EnableCors(handler http.Handler, c Cors) http.Handler

EnableCors - enable cors at application with base at configurate passed by params

func EnableLogs

func EnableLogs(handler http.Handler) http.Handler

EnableLogs - add logs at all request

func RespondWithJson

func RespondWithJson(w http.ResponseWriter, code int, payload interface{})

RespondWithJson - response formated with json

func Validate

func Validate(w http.ResponseWriter, object interface{}) bool

Validate - convert/get payload by json

Types

type Cors

type Cors struct {
	Methods []string
	Origins []string
}

Cors - struct of list to configurate CORS at application

type DefaultResponse

type DefaultResponse struct {
	Success bool
	Status  int
	Message string
}

DefaultResponse - struct default to simple response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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