response

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(r *http.Request) js.Json

Client function to get the client information

func GetBody

func GetBody(r *http.Request) (js.Json, error)

GetBody function to get the body of a request

func GetParam

func GetParam(r *http.Request, key string) *generic.Any

GetParam function to get the param of a request

func GetQuery

func GetQuery(r *http.Request) js.Json

GetQuery function to get the query of a request

func HTTPAlert

func HTTPAlert(w http.ResponseWriter, r *http.Request, message string) error

HTTPAlert function to return a json response

func HTTPApp

func HTTPApp(r chi.Router, path string, root http.FileSystem)

HTTPApp function to return a json response

func HTTPError

func HTTPError(w http.ResponseWriter, r *http.Request, statusCode int, message string) error

HTTPError function to return a json response

func ITEM

func ITEM(w http.ResponseWriter, r *http.Request, statusCode int, dt js.Item) error

ITEM function to return a json response

func ITEMS

func ITEMS(w http.ResponseWriter, r *http.Request, statusCode int, dt js.Items) error

ITEMS function to return a json response

func JSON

func JSON(w http.ResponseWriter, r *http.Request, statusCode int, dt interface{}) error

JSON function to return a json response

func ScanBody

func ScanBody(r io.Reader) (js.Json, error)

ScanBody function to scan the body of a request

func ScanJson

func ScanJson(value map[string]interface{}) (js.Json, error)

ScanJson function to scan a json

func ScanStr

func ScanStr(value string) (js.Json, error)

ScanStr function to scan a string

func Stream

func Stream(w http.ResponseWriter, r *http.Request, statusCode int, dt interface{}) error

Stream function to return a json response

func WriteResponse

func WriteResponse(w http.ResponseWriter, statusCode int, e []byte) error

WriteResponse function to write a response

Types

type Result

type Result struct {
	Ok     bool        `json:"ok"`
	Result interface{} `json:"result"`
}

Jump to

Keyboard shortcuts

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