response

package
v1.0.34 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBody added in v0.0.34

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

func GetParam added in v0.0.119

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

func GetQuery added in v0.0.119

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

func HTTPAlert

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

func HTTPApp

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

func HTTPError

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

func ITEM

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

func ITEMS

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

func JSON

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

func ScanBody added in v0.0.84

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

func ScanJson added in v0.0.96

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

func ScanStr added in v0.0.96

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

func Stream

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

func Unauthorized added in v1.0.8

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

func WriteResponse added in v0.0.52

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

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