Documentation
¶
Index ¶
- Constants
- Variables
- func AddCodeResponse(code int, body map[string]interface{})
- func AddHandler(method, route string, ...)
- func AddMiddleware(method, route string, ...)
- func AllowOrigin(origin string)
- func Connect(route string, handler func(*http.Request) (int, map[string]interface{}, error))
- func Delete(route string, handler func(*http.Request) (int, map[string]interface{}, error))
- func Get(route string, handler func(*http.Request) (int, map[string]interface{}, error))
- func Head(route string, handler func(*http.Request) (int, map[string]interface{}, error))
- func OptionalBool(it interface{}) (ok bool, _ error)
- func OptionalNumber(it interface{}) (ok bool, _ error)
- func OptionalString(it interface{}) (ok bool, _ error)
- func Options(route string, handler func(*http.Request) (int, map[string]interface{}, error))
- func Patch(route string, handler func(*http.Request) (int, map[string]interface{}, error))
- func Post(route string, handler func(*http.Request) (int, map[string]interface{}, error))
- func Put(route string, handler func(*http.Request) (int, map[string]interface{}, error))
- func Route(writer http.ResponseWriter, request *http.Request)
- func SerializeBody(reader io.Reader, target Fillable) (internal, external error)
- func Trace(route string, handler func(*http.Request) (int, map[string]interface{}, error))
- func ValidBool(it interface{}) (ok bool, _ error)
- func ValidEmail(it interface{}) (ok bool, _ error)
- func ValidNumber(it interface{}) (ok bool, _ error)
- func ValidString(it interface{}) (ok bool, _ error)
- func ValidStringSlice(it interface{}) (ok bool, _ error)
- func ValidUUID(it interface{}) (ok bool, _ error)
- type Fillable
- type FuncHandler
- type FuncMiddleware
- type Handler
- type Middleware
Constants ¶
View Source
const ( UUID_PATTERN = `[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}` UUID_ONLY_PATTERN = `^` + UUID_PATTERN + `$` EMAIL_PATTERN = "[^@]+@[^@]+" EMAIL_ONLY_PATTERN = `^` + EMAIL_PATTERN + `$` )
Variables ¶
View Source
var ( ErrInvalidTyping = fmt.Errorf("json body types do not match expected") ErrNilBody = fmt.Errorf("body reader is nil") )
Functions ¶
func AddCodeResponse ¶
func AddHandler ¶
func AddMiddleware ¶
func AllowOrigin ¶ added in v2.1.0
func AllowOrigin(origin string)
func OptionalBool ¶
func OptionalNumber ¶
func OptionalString ¶
func SerializeBody ¶
func ValidEmail ¶
func ValidNumber ¶
func ValidString ¶
func ValidStringSlice ¶
Types ¶
type FuncMiddleware ¶
type Middleware ¶
type Middleware struct { Func FuncMiddleware Method string Route *regexp.Regexp }
Click to show internal directories.
Click to hide internal directories.