Documentation ¶
Index ¶
- Constants
- Variables
- func BrowserClientInfo(c *web.Context) string
- func BrowserCookieUserID(c *web.Context) int64
- func BrowserID(c *web.Context) []byte
- func GetPasswordContainer(password string) []byte
- func TokenUserID(token []byte) int64
- func ValidPasswordForContainer(container []byte, password string) bool
- type Result
- type Session
- type Sessions
- func (s *Sessions) BrowserAccessSession(c *web.Context) (bool, bool)
- func (s *Sessions) BrowserCreateSession(c *web.Context, userID int64, permanentCookie bool)
- func (s *Sessions) BrowserLogout(c *web.Context)
- func (s *Sessions) Bytes() []byte
- func (s *Sessions) GenerateLogincode(letters string, length int, expires time.Duration) string
- func (s *Sessions) HasPassword() bool
- func (s *Sessions) LoginWithPassword(password string, maxFailedAttempts int64) Result
- func (s *Sessions) Sessions() []*Session
- func (s *Sessions) SetPassword(password string)
- func (s *Sessions) TokenAccessSession(token []byte, clientIP net.IP) (bool, bool)
- func (s *Sessions) TokenCreateSession(userID int64, deviceID []byte, clientInfo string, clientIP net.IP) []byte
- func (s *Sessions) TokenGetIOSPushToken(token []byte) []byte
- func (s *Sessions) TokenLogout(token []byte)
- func (s *Sessions) TokenReplaceUserID(token []byte, newUserID int64) []byte
- func (s *Sessions) TokenSetGooglePlayPushToken(token []byte, googlePlayPushToken []byte)
- func (s *Sessions) TokenSetIOSPushToken(token []byte, iosPushToken []byte)
- func (s *Sessions) ValidateLogincode(code string, maxTries int64) Result
Constants ¶
View Source
const ResultExpired = Result(3)
View Source
const ResultInvalid = Result(2)
View Source
const ResultMaxTries = Result(4)
View Source
const ResultValid = Result(1)
Variables ¶
View Source
var CookieDomain string
View Source
var SecretBytes []byte
Functions ¶
func BrowserClientInfo ¶
func BrowserCookieUserID ¶
func GetPasswordContainer ¶
func TokenUserID ¶
Types ¶
type Session ¶
type Session struct { Token []byte `protobuf:"1"` ClientInfo string `protobuf:"2"` // could be: user-agent, sdk version, app version, ... DeviceID []byte `protobuf:"10,opt"` LastIP []byte `protobuf:"11,opt"` LastAccess int64 `protobuf:"12,opt"` Created int64 `protobuf:"13,opt"` //utc_offset INT8 NOT NULL DEFAULT 0:::INT, // push IOSPushToken []byte `protobuf:"51,opt"` GooglePlayPushToken []byte `protobuf:"52,opt"` }
func (*Session) CreatedTime ¶
func (*Session) DeviceIDHex ¶
func (*Session) LastAccessTime ¶
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
func (*Sessions) BrowserAccessSession ¶
func (*Sessions) BrowserCreateSession ¶
func (*Sessions) BrowserLogout ¶
func (*Sessions) GenerateLogincode ¶
func (*Sessions) HasPassword ¶
func (*Sessions) LoginWithPassword ¶
func (*Sessions) SetPassword ¶
func (*Sessions) TokenAccessSession ¶
func (*Sessions) TokenCreateSession ¶
func (*Sessions) TokenGetIOSPushToken ¶
func (*Sessions) TokenLogout ¶
func (*Sessions) TokenReplaceUserID ¶
func (*Sessions) TokenSetGooglePlayPushToken ¶
func (*Sessions) TokenSetIOSPushToken ¶
Click to show internal directories.
Click to hide internal directories.