Documentation ¶
Index ¶
- Variables
- func BasicResponseHeaders(buffer *bytes.Buffer, httpVer []byte, stCode []byte, bodyLen int)
- func ChHttpVerCmp(req []byte, ver []byte) (res bool)
- func ChMethodIsApprove(method int, routerMethods []int) (approve bool)
- func ChStr3Cmp(ua []byte, c0, c1, c2, c3 byte) (res bool)
- func ChStr4Cmp(ua []byte, c0, c1, c2, c3, c4 byte) (res bool)
- func ChStr7Cmp(ua []byte, c0, c1, c2, c3, c4, c5, c6, c7 byte) (res bool)
- func ChStrCmp(s1 []byte, s2 []byte) bool
- type LogsOut
- type Meta
- type Sessions
- func (s *Sessions) GetIdentifierWithToken(token string) (identifier string, err error)
- func (s *Sessions) GetMetaWithIdentifier(identifier string) (data Meta, err error)
- func (s *Sessions) GetMetaWithToken(token string) (data Meta, identifier string, err error)
- func (s *Sessions) GetTokenWithIdentifier(identifier string) (token string, err error)
- func (s *Sessions) GetTokenWithRequest(req *include.ChRequest) (data Meta, identifier string, err error)
- func (s *Sessions) Register(res *include.ChResponse, identifier string, meta interface{}, expires int64) (token string, ok bool)
- func (s *Sessions) TokenAvailable(token string) bool
- func (s *Sessions) TokenAvailableWithIdentifier(identifier string) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var TermLogger = true
Functions ¶
func BasicResponseHeaders ¶
func ChHttpVerCmp ¶
func ChMethodIsApprove ¶
Types ¶
type LogsOut ¶
func NewLogsOut ¶
func NewLogsOut() *LogsOut
func (*LogsOut) AccessInfo ¶
AccessInfo append a new log into output queue
func (*LogsOut) SignalClose ¶
func (to *LogsOut) SignalClose()
SignalClose close program logs output before exit
type Meta ¶
type Meta struct { Data interface{} Expire int64 // contains filtered or unexported fields }
type Sessions ¶
type Sessions struct { DefaultExpire int64 ActiveSessions map[string]Meta TokenMap map[string]string // contains filtered or unexported fields }
func NewSessions ¶
func (*Sessions) GetIdentifierWithToken ¶
GetIdentifierWithToken <- as you see
func (*Sessions) GetMetaWithIdentifier ¶
GetMetaWithIdentifier <- as you see
func (*Sessions) GetMetaWithToken ¶
GetMetaWithToken <- as you see
func (*Sessions) GetTokenWithIdentifier ¶
GetTokenWithIdentifier <- as you see
func (*Sessions) GetTokenWithRequest ¶
func (*Sessions) Register ¶
func (s *Sessions) Register(res *include.ChResponse, identifier string, meta interface{}, expires int64) (token string, ok bool)
Register add user information into sessions table
func (*Sessions) TokenAvailable ¶
TokenAvailable if token valid and not expired then return true
func (*Sessions) TokenAvailableWithIdentifier ¶
TokenAvailableWithIdentifier <- as you see
Click to show internal directories.
Click to hide internal directories.