Documentation
¶
Index ¶
- func ParseOf[T any](r *Request, en *T) error
- func ParseTo[T any](r *Request) (T, error)
- type File
- type JSON
- type Netper
- 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) 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 ¶
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 ¶
func (*Request) GetBoolPtr ¶
func (*Request) GetFloat32Ptr ¶
func (*Request) GetFloat64 ¶
func (*Request) GetFloat64Ptr ¶
func (*Request) GetFragment ¶
func (*Request) GetFullUrl ¶
func (*Request) GetInt32Ptr ¶
func (*Request) GetInt64Ptr ¶
func (*Request) GetPassword ¶
func (*Request) GetRawPath ¶
func (*Request) GetRawQuery ¶
func (*Request) GetStringPtr ¶
func (*Request) GetUint32Ptr ¶
func (*Request) GetUint64Ptr ¶
func (*Request) GetUintPtr ¶
func (*Request) GetUsername ¶
func (*Request) HeaderFilled ¶
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 ¶
func PlugResponse ¶
func PlugResponse(w http.ResponseWriter) Response
type ResponseX ¶
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 ¶
func (*ResponseX) GetStatusMessage ¶
func (*ResponseX) GetStatusNumber ¶
func (*ResponseX) HttpStatusCode ¶
func (*ResponseX) Reply ¶
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) ReplyFailed ¶
ReplyFailed 'data' arguments only used on index 0 */
func (*ResponseX) ReplySuccess ¶
ReplySuccess 'data' arguments only used on index 0 */
func (*ResponseX) SetHttpCode ¶
func (*ResponseX) SetHttpStatusCode ¶
Click to show internal directories.
Click to hide internal directories.