chix

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Marshal is exported by gin/json package.
	Marshal = json.Marshal
	// Unmarshal is exported by gin/json package.
	Unmarshal = json.Unmarshal
	// MarshalIndent is exported by gin/json package.
	MarshalIndent = json.MarshalIndent
	// NewDecoder is exported by gin/json package.
	NewDecoder = json.NewDecoder
	// NewEncoder is exported by gin/json package.
	NewEncoder = json.NewEncoder
)

Functions

func BindJson

func BindJson(r *http.Request, obj interface{}) error

func BindQuery

func BindQuery(r *http.Request, obj interface{}) error

func BytesToString

func BytesToString(b []byte) string

BytesToString converts byte slice to string without a memory allocation.

func Respond

func Respond(w http.ResponseWriter, data interface{})

func RespondError

func RespondError(w http.ResponseWriter, code int)

RespondError return error message

func RespondErrorMsg

func RespondErrorMsg(w http.ResponseWriter, code int, msg string)

func RespondSuccess

func RespondSuccess(w http.ResponseWriter)

func StringToBytes

func StringToBytes(s string) []byte

StringToBytes converts string to byte slice without a memory allocation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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