response

package
v1.0.62 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBody

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

func GetParam

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

func GetQuery

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

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

func ScanJson

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

func ScanStr

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

func Stream

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

func Unauthorized

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

func WriteResponse

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