easyRequest

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: MIT Imports: 11 Imported by: 0

README

easyrequest

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(name string, f interface{}) error

func HandleEasyRequest

func HandleEasyRequest(w http.ResponseWriter, r *http.Request)

func WSBind added in v1.0.3

func WSBind(name string, f interface{}) error

func WSHandleEasyRequest added in v1.0.3

func WSHandleEasyRequest(w http.ResponseWriter, r *http.Request)

Types

type Request

type Request struct {
	W http.ResponseWriter
	R *http.Request
}

type Value

type Value interface {
	Err() error
	To(interface{}) error
	Float() float32
	Int() int
	String() string
	Bool() bool
	Object() map[string]Value
	Array() []Value
}

Value is a generic type of a JSON value (primitive, object, array) and optionally an error value.

type WsRequest added in v1.0.3

type WsRequest struct {
	W    http.ResponseWriter
	R    *http.Request
	Conn *websocket.Conn
}

Jump to

Keyboard shortcuts

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