Documentation ¶
Index ¶
- Constants
- Variables
- func AESDecrypt(src, key []byte) (dst []byte, err error)
- func AESEncrypt(src, key []byte) (dst []byte, err error)
- func Capitalize(str string) string
- func ConvertMapToStruct(params map[string]interface{}, val interface{})
- func CreateSessionId(username string, userId interface{}) ([16]byte, error)
- func HtmlUnknownMethod(ctx *fasthttp.RequestCtx)
- func Sha1String(key []byte, sum []byte) string
- func Switcher(v IMethodViewer)
- type CreaCookie
- type IMethodViewer
- type IViewer
- type JsonView
- type Session
- type View
- func (r *View) After()
- func (r *View) Before()
- func (r *View) Delete()
- func (r *View) Get()
- func (r *View) GetArgBytes(key string) []byte
- func (r *View) GetArgInt(key string) (int, error)
- func (r *View) GetArgString(key string) string
- func (r *View) GetCtx() *fasthttp.RequestCtx
- func (r *View) GetPostArgs(key string) string
- func (r *View) Head()
- func (r *View) Html404()
- func (r *View) Init()
- func (r *View) Options()
- func (r *View) Patch()
- func (r *View) Post()
- func (r *View) Put()
- func (r *View) Render()
- func (r *View) SetCtx(ctx *fasthttp.RequestCtx)
- func (r *View) Trace()
- type XmlView
Constants ¶
View Source
const CERASALT = "Crea@2019=="
Variables ¶
View Source
var ( SessionExpired = errors.New("session has been expired, logout") SessionNoThisKey = errors.New("has not key in session data") )
Functions ¶
func Capitalize ¶
Capitalize: change first character to upper 改变字符串首字母为大写
func ConvertMapToStruct ¶
func ConvertMapToStruct(params map[string]interface{}, val interface{})
ConvertMapToStruct params map fill struct
func CreateSessionId ¶
create new session, user id could not be repeat
func HtmlUnknownMethod ¶
func HtmlUnknownMethod(ctx *fasthttp.RequestCtx)
func Sha1String ¶
func Switcher ¶
func Switcher(v IMethodViewer)
Types ¶
type CreaCookie ¶
type IMethodViewer ¶
type IMethodViewer interface { Init() Before() Get() Post() Head() Options() Put() Patch() Delete() Trace() GetCtx() *fasthttp.RequestCtx SetCtx(ctx *fasthttp.RequestCtx) After() Render() }
type IViewer ¶
type IViewer interface { Before() After() GetCtx() *fasthttp.RequestCtx SetCtx(ctx *fasthttp.RequestCtx) }
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) Get ¶
get session , Get() return value and error. if time expire, Get() will return timeout error
type View ¶
type View struct { JinJaTpl bool Data Data // stored user values Ctx *fasthttp.RequestCtx Cookie *fasthttp.Cookie }
func (*View) GetArgBytes ¶
获取参数,通过标准get url方式传值 e.g. http://xxx.com/?id=1
func (*View) GetArgInt ¶
获取参数,通过标准get url方式传值 e.g. http://xxx.com/?id=1
func (*View) GetArgString ¶
获取参数,通过标准get url方式传值 e.g. http://xxx.com/?id=1
func (*View) GetCtx ¶
func (r *View) GetCtx() *fasthttp.RequestCtx
func (*View) GetPostArgs ¶
func (*View) Init ¶
func (r *View) Init()
combine this struct and rewrite those functions to reply http methods
func (*View) SetCtx ¶
func (r *View) SetCtx(ctx *fasthttp.RequestCtx)
Click to show internal directories.
Click to hide internal directories.