Documentation ¶
Index ¶
- Variables
- func AddGlbRespMidwares(mws ...interface{})
- func IntsRegExp(ies []interface{}) string
- func ReqResp(ictx iris.Context, as ...interface{}) (*Req, *RespStruct, context.Context)
- func StringsRegExp(elems []string) string
- func UintsRegExp(set ...interface{}) string
- type Req
- func (r *Req) AddCookie(c *http.Cookie)
- func (r *Req) Body(param string, patterns ...interface{}) (*ReqProp, *ae.Error)
- func (r *Req) ContentType() string
- func (r *Req) Cookie(name string) (*http.Cookie, error)
- func (r *Req) Cookies() []*http.Cookie
- func (r *Req) FastXheader(name string, patterns ...interface{}) *ReqProp
- func (r *Req) FastXparam(name string) *ReqProp
- func (r *Req) Header(param string, patterns ...interface{}) (*ReqProp, *ae.Error)
- func (r *Req) Headers() map[string]interface{}
- func (r *Req) Qparam(name string, patterns ...interface{}) (v *ReqProp, e *ae.Error)
- func (r *Req) Queries() map[string]interface{}
- func (r *Req) Query(param string, patterns ...interface{}) (*ReqProp, *ae.Error)
- func (r *Req) Uri() string
- func (r *Req) XHeader(name string, patterns ...interface{}) (v *ReqProp, e *ae.Error)
- func (r *Req) Xhost() string
- func (r *Req) Xparam(name string, patterns ...interface{}) (v *ReqProp, e *ae.Error)
- type ReqProp
- type RespContentDTO
- type RespStruct
- func (resp *RespStruct) AddMidwares(mws ...interface{})
- func (resp *RespStruct) CatchErrors(es ...*ae.Error) error
- func (resp *RespStruct) DelHeader(head string)
- func (resp *RespStruct) Header(head string) string
- func (resp *RespStruct) LoadOrSetHeader(k, v string)
- func (resp *RespStruct) ServeFile(f string, hps ...map[string]string) error
- func (resp *RespStruct) SetHeader(k, v string)
- func (resp *RespStruct) SetHeaders(heads map[string]string)
- func (resp *RespStruct) Write(a interface{}, d ...interface{}) error
- func (resp *RespStruct) WriteAliasId(alias string, id string) error
- func (resp *RespStruct) WriteCode(code int) error
- func (resp *RespStruct) WriteE(e *ae.Error) error
- func (resp *RespStruct) WriteErr(code int, msg string) error
- func (resp *RespStruct) WriteErrMsg(msg string) error
- func (resp *RespStruct) WriteError(err error) error
- func (resp *RespStruct) WriteHeader(code interface{})
- func (resp *RespStruct) WriteId(id string) error
- func (resp *RespStruct) WriteJSONP(varname string, d map[string]interface{}) error
- func (resp *RespStruct) WriteJointId(args ...interface{}) error
- func (resp *RespStruct) WriteOK() error
- func (resp *RespStruct) WriteRaw(ps ...interface{}) (int, error)
- func (resp *RespStruct) WriteSafeE(e ae.Error) error
- func (resp *RespStruct) WriteUint64AliasId(alias string, id uint64) error
- func (resp *RespStruct) WriteUint64Id(id uint64) error
- func (resp *RespStruct) WriteUintAliasId(alias string, id uint) error
- func (resp *RespStruct) WriteUintId(id uint) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
HideServerErr = defaultHideServerErr
)
View Source
var Log = aa.NewDefaultLog()
Functions ¶
func AddGlbRespMidwares ¶
func AddGlbRespMidwares(mws ...interface{})
func IntsRegExp ¶
func IntsRegExp(ies []interface{}) string
func ReqResp ¶
func ReqResp(ictx iris.Context, as ...interface{}) (*Req, *RespStruct, context.Context)
func StringsRegExp ¶
func UintsRegExp ¶
func UintsRegExp(set ...interface{}) string
Types ¶
type Req ¶
func (*Req) ContentType ¶
func (*Req) FastXheader ¶
func (*Req) FastXparam ¶
type ReqProp ¶
func NewReqProp ¶
type RespContentDTO ¶
type RespStruct ¶
type RespStruct struct {
// contains filtered or unexported fields
}
func Resp ¶
func Resp(ictx iris.Context, req *Req, as ...interface{}) *RespStruct
func (*RespStruct) AddMidwares ¶
func (resp *RespStruct) AddMidwares(mws ...interface{})
func (*RespStruct) CatchErrors ¶
func (resp *RespStruct) CatchErrors(es ...*ae.Error) error
func (*RespStruct) DelHeader ¶
func (resp *RespStruct) DelHeader(head string)
func (*RespStruct) Header ¶
func (resp *RespStruct) Header(head string) string
func (*RespStruct) LoadOrSetHeader ¶
func (resp *RespStruct) LoadOrSetHeader(k, v string)
func (*RespStruct) ServeFile ¶
func (resp *RespStruct) ServeFile(f string, hps ...map[string]string) error
1. set Last-Modified 2. check preconditions
- check If-Match
- check If-Unmodified-Since
- check If-None-Match
- check If-Modified-Since
- check If-Range
func (*RespStruct) SetHeader ¶
func (resp *RespStruct) SetHeader(k, v string)
func (*RespStruct) SetHeaders ¶
func (resp *RespStruct) SetHeaders(heads map[string]string)
func (*RespStruct) Write ¶
func (resp *RespStruct) Write(a interface{}, d ...interface{}) error
Write(404) Write(404, "Not Found") Write(ae.Error{}) Write(ae.Error{}, data) Write(ae.Error{}, data) Write(data)
func (*RespStruct) WriteAliasId ¶
func (resp *RespStruct) WriteAliasId(alias string, id string) error
func (*RespStruct) WriteCode ¶
func (resp *RespStruct) WriteCode(code int) error
func (*RespStruct) WriteErrMsg ¶
func (resp *RespStruct) WriteErrMsg(msg string) error
func (*RespStruct) WriteError ¶
func (resp *RespStruct) WriteError(err error) error
func (*RespStruct) WriteHeader ¶
func (resp *RespStruct) WriteHeader(code interface{})
func (*RespStruct) WriteId ¶
func (resp *RespStruct) WriteId(id string) error
返回插入数据的ID,ID 可能是联合主键,或者字段不为id,那么就会以对象形式返回 如: {"id":12314} {"id":"ADREDD"} {"id":{"k":"i_am_prinary_key"}} {"id": {"k":"", "uid":""}}
func (*RespStruct) WriteJSONP ¶
func (resp *RespStruct) WriteJSONP(varname string, d map[string]interface{}) error
func (*RespStruct) WriteJointId ¶
func (resp *RespStruct) WriteJointId(args ...interface{}) error
k1,v1, k2, v2, k3,v3
func (*RespStruct) WriteOK ¶
func (resp *RespStruct) WriteOK() error
func (*RespStruct) WriteRaw ¶
func (resp *RespStruct) WriteRaw(ps ...interface{}) (int, error)
func (*RespStruct) WriteSafeE ¶
func (resp *RespStruct) WriteSafeE(e ae.Error) error
func (*RespStruct) WriteUint64AliasId ¶
func (resp *RespStruct) WriteUint64AliasId(alias string, id uint64) error
func (*RespStruct) WriteUint64Id ¶
func (resp *RespStruct) WriteUint64Id(id uint64) error
func (*RespStruct) WriteUintAliasId ¶
func (resp *RespStruct) WriteUintAliasId(alias string, id uint) error
func (*RespStruct) WriteUintId ¶
func (resp *RespStruct) WriteUintId(id uint) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.