response

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client added in v0.0.2

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

Client function to get the client information

func GetBody

func GetBody(r *http.Request) (et.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) et.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 et.Item) error

ITEM function to return a json response

func ITEMS

func ITEMS(w http.ResponseWriter, r *http.Request, statusCode int, dt et.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) (et.Json, error)

ScanBody function to scan the body of a request

func ScanJson

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

ScanJson function to scan a json

func ScanStr

func ScanStr(value string) (et.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