Documentation ¶
Overview ¶
Package httpjson provides utilities to handle Shana-opinioned HTTP JSON requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { IP string `shana:"ip"` // The IP to bind. If it's not set, all IPs are bound. Port int `shana:"port"` // The port to listen. PkgPrefix string `shana:"-"` // Filter all exported routes by package prefix. }
Config for http server.
type DebugInfo ¶
type DebugInfo struct { FuncName string `json:"funcName,omitempty"` Errors []string `json:"errors,omitempty"` }
DebugInfo contains more debug information.
type Response ¶
type Response struct { Code any `json:"code,omitempty"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` Debug *DebugInfo `json:"_debug,omitempty"` // Only valid when debug is enabled. Data any `json:"data,omitempty"` }
Response is the Shana-opinioned HTTP JSON protocol response.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is a HTTP JSON router.
Click to show internal directories.
Click to hide internal directories.