Documentation ¶
Index ¶
- Variables
- func DumpJSON(w http.ResponseWriter, code int, serializable interface{})
- func DumpJSONData(serializable interface{}) ([]byte, error)
- func LoadJSON(data []byte, deserializable interface{}) (err error)
- func LoadJSONReader(r io.Reader, deserializable interface{}) (err error)
- type ResponseMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 200 ResponseOK = ResponseMessage(http.StatusText(http.StatusOK)) ResponsePartialContent = ResponseMessage(http.StatusText(http.StatusPartialContent)) // 300 ResponseMovedPermanently = ResponseMessage(http.StatusText(http.StatusMovedPermanently)) ResponseFound = ResponseMessage(http.StatusText(http.StatusFound)) ResponseSeeOther = ResponseMessage(http.StatusText(http.StatusSeeOther)) ResponseTemporaryRedirect = ResponseMessage(http.StatusText(http.StatusTemporaryRedirect)) ResponsePermanentRedirect = ResponseMessage(http.StatusText(http.StatusPermanentRedirect)) ResponsePaymentRequired = ResponseMessage(http.StatusText(http.StatusPaymentRequired)) // 400 ResponseBadRequest = ResponseMessage(http.StatusText(http.StatusBadRequest)) ResponseForbidden = ResponseMessage(http.StatusText(http.StatusForbidden)) ResponseNotFound = ResponseMessage(http.StatusText(http.StatusNotFound)) ResponseMethodNotAllowed = ResponseMessage(http.StatusText(http.StatusMethodNotAllowed)) ResponseNotAcceptable = ResponseMessage(http.StatusText(http.StatusNotAcceptable)) ResponseRequestTimeout = ResponseMessage(http.StatusText(http.StatusRequestTimeout)) ResponseConflict = ResponseMessage(http.StatusText(http.StatusConflict)) ResponseGone = ResponseMessage(http.StatusText(http.StatusGone)) ResponsePreconditionFailed = ResponseMessage(http.StatusText(http.StatusPreconditionFailed)) ResponseRequestEntityTooLarge = ResponseMessage(http.StatusText(http.StatusRequestEntityTooLarge)) ResponseRequestURITooLong = ResponseMessage(http.StatusText(http.StatusRequestURITooLong)) ResponseUnsupportedMediaType = ResponseMessage(http.StatusText(http.StatusUnsupportedMediaType)) ResponseUpgradeRequired = ResponseMessage(http.StatusText(http.StatusUpgradeRequired)) ResponsePreconditionRequired = ResponseMessage(http.StatusText(http.StatusPreconditionRequired)) ResponseTooManyRequests = ResponseMessage(http.StatusText(http.StatusTooManyRequests)) ResponseRequestHeaderFieldsTooLarge = ResponseMessage(http.StatusText(http.StatusRequestHeaderFieldsTooLarge)) // 500 ResponseInternalServerError = ResponseMessage(http.StatusText(http.StatusInternalServerError)) ResponseNotImplemented = ResponseMessage(http.StatusText(http.StatusNotImplemented)) ResponseBadGateway = ResponseMessage(http.StatusText(http.StatusBadGateway)) ResponseGatewayTimeout = ResponseMessage(http.StatusText(http.StatusGatewayTimeout)) ResponseHTTPVersionNotSupported = ResponseMessage(http.StatusText(http.StatusHTTPVersionNotSupported)) ResponseInsufficientStorage = ResponseMessage(http.StatusText(http.StatusInsufficientStorage)) )
View Source
var (
JSONConfig = json.ConfigFastest
)
Functions ¶
func DumpJSON ¶
func DumpJSON(w http.ResponseWriter, code int, serializable interface{})
func DumpJSONData ¶
func LoadJSONReader ¶
Types ¶
type ResponseMessage ¶
type ResponseMessage string
func (ResponseMessage) MarshalJSON ¶
func (rm ResponseMessage) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.