Documentation
¶
Overview ¶
salt cache
Index ¶
- func CheckBySalt(keyId, salt int64) bool
- func GetOrInsertSalt(keyId int64) (int64, error)
- func GetOrInsertSaltList(keyId int64, size int) ([]*mtproto.TLFutureSalt, error)
- type AuthSessionModel
- func (m *AuthSessionModel) BindAuthKeyUser(authKeyId int64, userId int32) bool
- func (m *AuthSessionModel) GetApiLayer(authKeyId int64) int32
- func (m *AuthSessionModel) GetAuthKeyUserId(authKeyId int64) int32
- func (m *AuthSessionModel) GetAuthorizations(userId int32) (authorizations []*mtproto.Authorization)
- func (m *AuthSessionModel) InsertAuthKey(authKeyId int64, authKey []byte, salt *mtproto.TLFutureSalt) (err error)
- func (m *AuthSessionModel) QueryAuthKey(authKeyId int64) (*mtproto.AuthKeyInfo, error)
- func (m *AuthSessionModel) ResetAuthorization(hash int64) int64
- func (m *AuthSessionModel) SetClientSessionInfo(session *mtproto.TLClientSessionInfo) bool
- func (m *AuthSessionModel) UnbindAuthUser(authKeyId int64, userId int32) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckBySalt ¶
Server Salt
A (random) 64-bit number periodically (say, every 24 hours) changed (separately for each session) at the request of the server. All subsequent messages must contain the new salt (although, messages with the old salt are still accepted for a further 300 seconds). Required to protect against replay attacks and certain tricks associated with adjusting the client clock to a moment in the distant future.
func GetOrInsertSalt ¶
func GetOrInsertSaltList ¶
func GetOrInsertSaltList(keyId int64, size int) ([]*mtproto.TLFutureSalt, error)
Types ¶
type AuthSessionModel ¶
type AuthSessionModel struct {
// contains filtered or unexported fields
}
func NewAuthSessionModel ¶
func NewAuthSessionModel(dbName, redisName string) *AuthSessionModel
func (*AuthSessionModel) BindAuthKeyUser ¶
func (m *AuthSessionModel) BindAuthKeyUser(authKeyId int64, userId int32) bool
func (*AuthSessionModel) GetApiLayer ¶
func (m *AuthSessionModel) GetApiLayer(authKeyId int64) int32
func (*AuthSessionModel) GetAuthKeyUserId ¶
func (m *AuthSessionModel) GetAuthKeyUserId(authKeyId int64) int32
func (*AuthSessionModel) GetAuthorizations ¶
func (m *AuthSessionModel) GetAuthorizations(userId int32) (authorizations []*mtproto.Authorization)
func (*AuthSessionModel) InsertAuthKey ¶
func (m *AuthSessionModel) InsertAuthKey(authKeyId int64, authKey []byte, salt *mtproto.TLFutureSalt) (err error)
func (*AuthSessionModel) QueryAuthKey ¶
func (m *AuthSessionModel) QueryAuthKey(authKeyId int64) (*mtproto.AuthKeyInfo, error)
func (*AuthSessionModel) ResetAuthorization ¶
func (m *AuthSessionModel) ResetAuthorization(hash int64) int64
func (*AuthSessionModel) SetClientSessionInfo ¶
func (m *AuthSessionModel) SetClientSessionInfo(session *mtproto.TLClientSessionInfo) bool
func (*AuthSessionModel) UnbindAuthUser ¶
func (m *AuthSessionModel) UnbindAuthUser(authKeyId int64, userId int32) bool
Click to show internal directories.
Click to hide internal directories.