Documentation ¶
Index ¶
- type FileServer
- type HTMLer
- type InputSource
- type InputValue
- func (i InputValue) Each(h JsonHandler) error
- func (i InputValue) GetBool() (bool, error)
- func (i InputValue) GetFloat() (float64, error)
- func (i InputValue) GetInt() (int64, error)
- func (i InputValue) GetString() string
- func (i InputValue) GetUInt() (uint64, error)
- func (i InputValue) GetValue(key string) (InputValue, jsonparser.ValueType, error)
- func (i InputValue) Unmarshal(v interface{}) error
- type JsonHandler
- type RequestContract
- type ResponseContract
- type TemplateResponseContract
- type UploadFile
- type WithContentType
- type WithHeaders
- type WithStatusCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileServer ¶
type InputSource ¶
type InputSource interface { Get(key string) []byte ParamBytes(key string) []byte File(key string) (UploadFile, error) GetValue(key ...string) InputValue }
InputSource is general input source
type InputValue ¶
type InputValue []byte
func (InputValue) Each ¶
func (i InputValue) Each(h JsonHandler) error
func (InputValue) GetBool ¶
func (i InputValue) GetBool() (bool, error)
func (InputValue) GetFloat ¶
func (i InputValue) GetFloat() (float64, error)
func (InputValue) GetInt ¶
func (i InputValue) GetInt() (int64, error)
func (InputValue) GetString ¶
func (i InputValue) GetString() string
func (InputValue) GetUInt ¶
func (i InputValue) GetUInt() (uint64, error)
func (InputValue) GetValue ¶
func (i InputValue) GetValue(key string) (InputValue, jsonparser.ValueType, error)
func (InputValue) Unmarshal ¶
func (i InputValue) Unmarshal(v interface{}) error
type JsonHandler ¶
type JsonHandler func(value InputValue, dataType jsonparser.ValueType)
type RequestContract ¶
type RequestContract interface { InputSource Context() context.Context Params() map[string][]byte Param(key string) string ParamInt64(key string) (int64, error) ParamUint64(key string) (uint64, error) ParamInt(key string) (int, error) SetParams(params map[string][]byte) SetParamsSlice(paramsSlice [][]byte) ParamsSlice() [][]byte Accepts() []byte ExceptsJson() bool RequestWithJson() bool IsXmlHttpRequest() bool GetMethod() string GetPathBytes() []byte GetUri() []byte GetInt64(key string) (int64, error) GetUint64(key string) (uint64, error) GetString(key string) string GetInt(key string) (int, error) GetClientIp() string GetContent() []byte Unmarshal(to interface{}) error GetSignature() []byte Header(key string) []byte HeaderString(key string) string SetHeader(key string, value []byte) RequestContract SetHeaderString(key, value string) RequestContract Authorization() []byte BearerToken() ([]byte, error) ToString() string }
RequestContract is interface of http request
type ResponseContract ¶
type ResponseContract interface { Content() []byte Headers() map[string]string SetHeader(key string, value string) ResponseContract SetHeaders(headers map[string]string) ResponseContract StatusCode() int SetStatusCode(code int) ResponseContract Handled() bool }
type UploadFile ¶
type WithContentType ¶ added in v0.0.8
type WithContentType interface {
ContentType() string
}
type WithHeaders ¶
type WithStatusCode ¶
type WithStatusCode interface {
StatusCode() int
}
Click to show internal directories.
Click to hide internal directories.