Documentation ¶
Index ¶
- Constants
- type GenerateTokenFunc
- type HandlerFunc
- type Login
- type QRCode
- type QRCodeState
- type Refresh
- type RefreshRes
- type RefreshTokenSign
- type Result
- type Session
- func (s *Session) AddDistinctValueTokenSign(sign *TokenSign)
- func (s *Session) AddTokenSign(sign *TokenSign)
- func (s *Session) Get(key string) interface{}
- func (s *Session) GetAllDevice() []string
- func (s *Session) GetFilterTokenSign(device string) *list.List
- func (s *Session) GetFilterTokenSignSlice(device string) []*TokenSign
- func (s *Session) GetLastTokenByDevice(device string) string
- func (s *Session) GetOrSet(key string, obj interface{}) (interface{}, bool)
- func (s *Session) GetTokenSign(tokenValue string) *TokenSign
- func (s *Session) GetTokenSignListCopy() *list.List
- func (s *Session) Json() string
- func (s *Session) RemoveTokenSign(tokenValue string) bool
- func (s *Session) RemoveTokenSignByIndex(i int)
- func (s *Session) Set(key string, obj interface{})
- func (s *Session) String() string
- func (s *Session) TokenSignSize() int
- type SyncSession
- func ConvertSyncSession(s *Session) *SyncSession
- func DefaultSyncSession(id string) *SyncSession
- func JsonByteToSyncSession(jsonByte []byte) (*SyncSession, error)
- func JsonToSyncSession(jsonStr string) (*SyncSession, error)
- func NewSyncSession(id string, sessionType string, loginId string) *SyncSession
- func (s *SyncSession) AddTokenSign(sign *TokenSign)
- func (s *SyncSession) Get(key string) interface{}
- func (s *SyncSession) GetFilterTokenSign(device string) *list.List
- func (s *SyncSession) GetLastTokenByDevice(device string) string
- func (s *SyncSession) GetOrSet(key string, obj interface{}) (interface{}, bool)
- func (s *SyncSession) GetTokenSign(tokenValue string) *TokenSign
- func (s *SyncSession) GetTokenSignListCopy() *list.List
- func (s *SyncSession) Json() string
- func (s *SyncSession) RemoveTokenSign(tokenValue string) bool
- func (s *SyncSession) RemoveTokenSignByIndex(i int)
- func (s *SyncSession) Set(key string, obj interface{})
- func (s *SyncSession) TokenSignSize() int
- func (s *SyncSession) UnmarshalBytes(jsonByte []byte) (*SyncSession, error)
- func (s *SyncSession) UnmarshalStr(jsonStr string) (*SyncSession, error)
- type TokenSign
Constants ¶
const ( SUCCESS = 1 ERROR = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenerateTokenFunc ¶
type GenerateTokenFunc struct {
// contains filtered or unexported fields
}
func LoadFunctionMap ¶
func LoadFunctionMap() GenerateTokenFunc
func (*GenerateTokenFunc) AddFunc ¶
func (g *GenerateTokenFunc) AddFunc(key string, f HandlerFunc)
func (*GenerateTokenFunc) GetFunction ¶
func (g *GenerateTokenFunc) GetFunction(tokenForm string) (HandlerFunc, error)
type HandlerFunc ¶ added in v0.1.3
type Login ¶
type Login struct { Device string IsLastingCookie bool Timeout int64 JwtData map[string]interface{} Token string RefreshToken string RefreshTokenTimeout int64 }
func CreateLoginModelByDevice ¶ added in v0.1.7
func DefaultLoginModel ¶
func DefaultLoginModel() *Login
type QRCode ¶ added in v0.1.3
type QRCode struct { Id string State QRCodeState LoginId string Ticket string }
type QRCodeState ¶ added in v0.1.3
type QRCodeState int
const ( WaitScan QRCodeState = 1 WaitAuth QRCodeState = 2 ConfirmAuth QRCodeState = 3 CancelAuth QRCodeState = 4 Expired QRCodeState = 5 )
QRCode State
type Refresh ¶ added in v0.1.7
type Refresh struct { IsLastingCookie bool Token string Timeout int64 JwtData map[string]interface{} RefreshToken string RefreshTokenTimeout int64 }
func DefaultRefresh ¶ added in v0.1.7
func DefaultRefresh() *Refresh
type RefreshRes ¶ added in v0.1.7
func (*RefreshRes) String ¶ added in v0.1.7
func (r *RefreshRes) String() string
type RefreshTokenSign ¶ added in v0.1.7
type Session ¶
type Session struct { Id string Type string LoginType string LoginId string Token string CreateTime int64 DataMap map[string]interface{} TokenSignList []*TokenSign `json:"TokenSignList"` }
func DefaultSession ¶
func (*Session) AddDistinctValueTokenSign ¶ added in v0.1.7
AddDistinctValueTokenSign check tokenValue ,then add TokenSign
func (*Session) AddTokenSign ¶
AddTokenSign add TokenSign
func (*Session) GetAllDevice ¶ added in v0.1.7
func (*Session) GetFilterTokenSign ¶
GetFilterTokenSign filter by TokenSign.Device from all TokenSign
func (*Session) GetFilterTokenSignSlice ¶ added in v0.1.7
func (*Session) GetLastTokenByDevice ¶
GetLastTokenByDevice get TokenSign.Value by device
func (*Session) GetOrSet ¶ added in v0.0.6
GetOrSet returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.
func (*Session) GetTokenSign ¶
GetTokenSign find TokenSign by TokenSign.Value
func (*Session) GetTokenSignListCopy ¶
GetTokenSignListCopy find all TokenSign
func (*Session) RemoveTokenSign ¶
RemoveTokenSign remove TokenSign by TokenSign.Value
func (*Session) RemoveTokenSignByIndex ¶ added in v0.0.4
RemoveTokenSignByIndex delete by index
func (*Session) TokenSignSize ¶ added in v0.0.4
TokenSignSize get tokenSign size
type SyncSession ¶ added in v0.0.6
type SyncSession struct { Id string Type string LoginType string LoginId string Token string CreateTime int64 DataMap *sync.Map TokenSignList []*TokenSign `json:"TokenSignList"` }
SyncSession sync SyncSession
func ConvertSyncSession ¶ added in v0.0.6
func ConvertSyncSession(s *Session) *SyncSession
ConvertSyncSession convert to Session
func DefaultSyncSession ¶ added in v0.0.6
func DefaultSyncSession(id string) *SyncSession
func JsonByteToSyncSession ¶ added in v0.0.6
func JsonByteToSyncSession(jsonByte []byte) (*SyncSession, error)
func JsonToSyncSession ¶ added in v0.0.6
func JsonToSyncSession(jsonStr string) (*SyncSession, error)
func NewSyncSession ¶ added in v0.0.6
func NewSyncSession(id string, sessionType string, loginId string) *SyncSession
func (*SyncSession) AddTokenSign ¶ added in v0.0.6
func (s *SyncSession) AddTokenSign(sign *TokenSign)
AddTokenSign add TokenSign
func (*SyncSession) Get ¶ added in v0.0.6
func (s *SyncSession) Get(key string) interface{}
Get returns data from DataMap
func (*SyncSession) GetFilterTokenSign ¶ added in v0.0.6
func (s *SyncSession) GetFilterTokenSign(device string) *list.List
GetFilterTokenSign filter by TokenSign.Device from all TokenSign
func (*SyncSession) GetLastTokenByDevice ¶ added in v0.0.6
func (s *SyncSession) GetLastTokenByDevice(device string) string
GetLastTokenByDevice get TokenSign.Value by device
func (*SyncSession) GetOrSet ¶ added in v0.0.6
func (s *SyncSession) GetOrSet(key string, obj interface{}) (interface{}, bool)
GetOrSet returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.
func (*SyncSession) GetTokenSign ¶ added in v0.0.6
func (s *SyncSession) GetTokenSign(tokenValue string) *TokenSign
GetTokenSign find TokenSign by TokenSign.Value
func (*SyncSession) GetTokenSignListCopy ¶ added in v0.0.6
func (s *SyncSession) GetTokenSignListCopy() *list.List
GetTokenSignListCopy find all TokenSign
func (*SyncSession) Json ¶ added in v0.0.6
func (s *SyncSession) Json() string
Json return json string
func (*SyncSession) RemoveTokenSign ¶ added in v0.0.6
func (s *SyncSession) RemoveTokenSign(tokenValue string) bool
RemoveTokenSign remove TokenSign by TokenSign.Value
func (*SyncSession) RemoveTokenSignByIndex ¶ added in v0.0.6
func (s *SyncSession) RemoveTokenSignByIndex(i int)
RemoveTokenSignByIndex delete by index
func (*SyncSession) Set ¶ added in v0.0.6
func (s *SyncSession) Set(key string, obj interface{})
func (*SyncSession) TokenSignSize ¶ added in v0.0.6
func (s *SyncSession) TokenSignSize() int
TokenSignSize get tokenSign size
func (*SyncSession) UnmarshalBytes ¶ added in v0.0.6
func (s *SyncSession) UnmarshalBytes(jsonByte []byte) (*SyncSession, error)
UnmarshalBytes convert bytes to SyncSession
func (*SyncSession) UnmarshalStr ¶ added in v0.0.6
func (s *SyncSession) UnmarshalStr(jsonStr string) (*SyncSession, error)
UnmarshalStr convert string to SyncSession