Documentation ¶
Index ¶
- func ParseOf[T any](r *Request, en *T) error
- func ParseTo[T any](r *Request) (T, error)
- type File
- type JSON
- type Jumper
- type Number
- type Params
- type Request
- func (r *Request) Append(key string, val string)
- func (r *Request) Filled(keys ...string) (found bool)
- func (r *Request) Get(key string) interface{}
- func (r *Request) GetAll() map[string]interface{}
- func (r *Request) GetArray(key string) []interface{}
- func (r *Request) GetArrayUniquify(key string) []interface{}
- func (r *Request) GetBool(key string) bool
- func (r *Request) GetBoolPtr(key string) *bool
- func (r *Request) GetFile(key string) (*File, error)
- func (r *Request) GetFiles(key string) ([]*File, error)
- func (r *Request) GetFloat(key string) float32
- func (r *Request) GetFloat32Ptr(key string) *float32
- func (r *Request) GetFloat64(key string) float64
- func (r *Request) GetFloat64Ptr(key string) *float64
- func (r *Request) GetFragment() string
- func (r *Request) GetFullUrl() string
- func (r *Request) GetHost() string
- func (r *Request) GetInt(key string) int
- func (r *Request) GetInt32(key string) int32
- func (r *Request) GetInt32Ptr(key string) *int32
- func (r *Request) GetInt64(key string) int64
- func (r *Request) GetInt64Ptr(key string) *int64
- func (r *Request) GetIntPtr(key string) *int
- func (r *Request) GetJSON(key string) JSON
- func (r *Request) GetMap(key string) map[string]interface{}
- func (r *Request) GetOpaque() string
- func (r *Request) GetPassword() string
- func (r *Request) GetPath() string
- func (r *Request) GetPort() string
- func (r *Request) GetPtr(key string) *interface{}
- func (r *Request) GetRawPath() string
- func (r *Request) GetRawQuery() string
- func (r *Request) GetScheme() string
- func (r *Request) GetSegment(key string) string
- func (r *Request) GetSegmentInt(key string) int
- func (r *Request) GetSegmentInt32(key string) int32
- func (r *Request) GetSegmentInt64(key string) int64
- func (r *Request) GetSegmentUint(key string) uint
- func (r *Request) GetSegmentUint32(key string) uint32
- func (r *Request) GetSegmentUint64(key string) uint64
- func (r *Request) GetString(key string) string
- func (r *Request) GetStringPtr(key string) *string
- func (r *Request) GetStruct(obj interface{}) error
- func (r *Request) GetTime(key string) (*time.Time, error)
- func (r *Request) GetTimeNE(key string) *time.Time
- func (r *Request) GetUint(key string) uint
- func (r *Request) GetUint32(key string) uint32
- func (r *Request) GetUint32Ptr(key string) *uint32
- func (r *Request) GetUint64(key string) uint64
- func (r *Request) GetUint64Ptr(key string) *uint64
- func (r *Request) GetUintPtr(key string) *uint
- func (r *Request) GetUrl() string
- func (r *Request) GetUsername() string
- func (r *Request) Has(keys ...string) (found bool)
- func (r *Request) HasFile(keys ...string) (found bool)
- func (r *Request) HasHeader(keys ...string) (found bool)
- func (r *Request) HasUser() bool
- func (r *Request) Header(key string) string
- func (r *Request) HeaderFilled(keys ...string) (found bool)
- type Response
- type ResponseX
- func (r *ResponseX) GetData() any
- func (r *ResponseX) GetStatus() int
- func (r *ResponseX) GetStatusCode() string
- func (r *ResponseX) GetStatusMessage() string
- func (r *ResponseX) GetStatusNumber() string
- func (r *ResponseX) HttpStatusCode() int
- func (r *ResponseX) Reply(status int, number string, code string, message string, data ...any) error
- func (r *ResponseX) ReplyAs(res Response) error
- func (r *ResponseX) ReplyCustom(httpStatusCode int, res any) error
- func (r *ResponseX) ReplyFailed(number string, code string, message string, data ...any) error
- func (r *ResponseX) ReplySuccess(number string, code string, message string, data ...any) error
- func (r *ResponseX) SetHttpCode(code int) Response
- func (r *ResponseX) SetHttpStatusCode(httpStatusCode int) Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) GetFileHeader ¶
func (f *File) GetFileHeader() *multipart.FileHeader
type Request ¶ added in v2.0.1
type Request struct { Method string ClientIP string ClientPort string // contains filtered or unexported fields }
func PlugRequest ¶
func PlugRequest(r *http.Request, w http.ResponseWriter) *Request
func TouchRequest ¶
func TouchRequest(r *http.Request, w http.ResponseWriter) *Request
TouchRequest touch request with rewrite to reader, so handler can reuse the reader.
func (*Request) GetArrayUniquify ¶ added in v2.0.1
func (*Request) GetBoolPtr ¶ added in v2.0.1
func (*Request) GetFloat32Ptr ¶ added in v2.0.1
func (*Request) GetFloat64 ¶ added in v2.0.1
func (*Request) GetFloat64Ptr ¶ added in v2.0.1
func (*Request) GetFragment ¶ added in v2.0.1
func (*Request) GetFullUrl ¶ added in v2.0.1
func (*Request) GetInt32Ptr ¶ added in v2.0.1
func (*Request) GetInt64Ptr ¶ added in v2.0.1
func (*Request) GetPassword ¶ added in v2.0.1
func (*Request) GetRawPath ¶ added in v2.0.1
func (*Request) GetRawQuery ¶ added in v2.0.1
func (*Request) GetSegment ¶ added in v2.0.1
func (*Request) GetSegmentInt ¶ added in v2.0.1
func (*Request) GetSegmentInt32 ¶ added in v2.0.1
func (*Request) GetSegmentInt64 ¶ added in v2.0.1
func (*Request) GetSegmentUint ¶ added in v2.0.1
func (*Request) GetSegmentUint32 ¶ added in v2.0.1
func (*Request) GetSegmentUint64 ¶ added in v2.0.1
func (*Request) GetStringPtr ¶ added in v2.0.1
func (*Request) GetUint32Ptr ¶ added in v2.0.1
func (*Request) GetUint64Ptr ¶ added in v2.0.1
func (*Request) GetUintPtr ¶ added in v2.0.1
func (*Request) GetUsername ¶ added in v2.0.1
func (*Request) HeaderFilled ¶ added in v2.0.1
type Response ¶
type Response interface { SetHttpCode(code int) Response ReplyAs(res Response) error Reply(status int, number string, code string, message string, data ...any) error ReplyFailed(number string, code string, message string, data ...any) error ReplySuccess(number string, code string, message string, data ...any) error ReplyCustom(httpStatusCode int, res any) error HttpStatusCode() int SetHttpStatusCode(httpStatusCode int) Response GetStatus() int GetStatusNumber() string GetStatusCode() string GetStatusMessage() string GetData() any }
func NewResponse ¶ added in v2.2.0
func PlugResponse ¶
func PlugResponse(w http.ResponseWriter) Response
type ResponseX ¶ added in v2.2.0
type ResponseX struct { Status int `json:"status"` StatusNumber string `json:"status_number"` StatusCode string `json:"status_code"` StatusMessage string `json:"status_message"` Data any `json:"data"` // contains filtered or unexported fields }
func (*ResponseX) GetStatusCode ¶ added in v2.2.0
func (*ResponseX) GetStatusMessage ¶ added in v2.2.0
func (*ResponseX) GetStatusNumber ¶ added in v2.2.0
func (*ResponseX) HttpStatusCode ¶ added in v2.2.0
func (*ResponseX) Reply ¶ added in v2.2.0
func (r *ResponseX) Reply(status int, number string, code string, message string, data ...any) error
Reply 'data' arguments only used on index 0 */
func (*ResponseX) ReplyCustom ¶ added in v2.2.3
func (*ResponseX) ReplyFailed ¶ added in v2.2.0
ReplyFailed 'data' arguments only used on index 0 */
func (*ResponseX) ReplySuccess ¶ added in v2.2.0
ReplySuccess 'data' arguments only used on index 0 */
func (*ResponseX) SetHttpCode ¶ added in v2.2.0
func (*ResponseX) SetHttpStatusCode ¶ added in v2.2.0
Click to show internal directories.
Click to hide internal directories.