response

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Forbidden added in v0.0.4

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

func GetArray added in v0.0.4

func GetArray(r *http.Request) ([]et.Json, error)

* * GetArray * @param r *http.Request * @return []et.Json, error *

func GetBody

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

* * GetBody * @param r *http.Request * @return et.Json, error *

func GetParam

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

* * GetParam * @param r *http.Request * @param key string * @return string *

func GetQuery

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

* * GetQuery * @param r *http.Request * @return 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)

* * HTTPApp * @param r chi.Router * @param path string * @param root http.FileSystem *

func HTTPError

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

* * HTTPError * @param w http.ResponseWriter * @param r *http.Request * @param statusCode int * @param message string * @return error *

func ITEM

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

* * ITEM * @param w http.ResponseWriter * @param r *http.Request * @param statusCode int * @param dt et.Item * @return error *

func ITEMS

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

* * ITEMS * @param w http.ResponseWriter * @param r *http.Request * @param statusCode int * @param dt et.Items * @return error *

func InternalServerError added in v0.0.4

func InternalServerError(w http.ResponseWriter, r *http.Request, err error)

func JSON

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

* * JSON * @param w http.ResponseWriter * @param r *http.Request * @param statusCode int * @param dt interface{} * @return error *

func ScanBody

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

* * ScanBody * @param r io.Reader * @return et.Json, error *

func ScanJson

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

* * ScanJson * @param value map[string]interface{} * @return et.Json, error *

func ScanStr

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

* * ScanStr * @param value string * @return et.Json, error *

func Stream

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

* * Stream * @param w http.ResponseWriter * @param r *http.Request * @param statusCode int * @param dt interface{} * @return error *

func Unauthorized added in v0.0.4

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

func WriteResponse

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

* * WriteResponse * @param w http.ResponseWriter * @param statusCode int * @param e []byte * @return 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