Documentation ¶
Index ¶
- Constants
- Variables
- type Session
- type SessionLoader
- type StringSession
- func (s StringSession) AppendAllValues() string
- func (s StringSession) Decode() (AuthKey, AuthKeyHash []byte, DcID int, IpAddr string, AppID int32, err error)
- func (s StringSession) Encode() []byte
- func (s StringSession) EncodeToString() string
- func (s StringSession) GetAuthKey() string
- func (s StringSession) GetAuthKeyHash() string
- func (s StringSession) GetDCID() int
- func (s StringSession) SplitValues(DecodedString string) (AuthKey, AuthKeyHash []byte, IpAddr string, DcID int, AppID int32)
Constants ¶
View Source
const (
Prefix = "1Bv"
)
View Source
const (
SessionAESKey = "1234567890123456"
)
Variables ¶
View Source
var ( ErrSessionNotFound = errors.New("session not found") ErrPathNotFound = "file not found" ErrFileNotExists = "no such file or directory" )
Functions ¶
This section is empty.
Types ¶
type Session ¶
Sesion is a basic data of specific session. Typically, session stores default hostname of mtproto server (cause all accounts ties to specific server after sign in), session key, server hash and salt.
type SessionLoader ¶
type SessionLoader interface { Load() (*Session, error) Store(*Session) error Path() string Delete() error }
SessionLoader is the interface which allows you to access sessions from different storages (like filesystem, database, s3 storage, etc.)
func NewFromFile ¶
func NewFromFile(path string) SessionLoader
func NewInMemory ¶
func NewInMemory() SessionLoader
type StringSession ¶
type StringSession struct { AuthKey []byte AuthKeyHash []byte DCID int IpAddr string AppID int32 Encoded string }
func (StringSession) AppendAllValues ¶
func (s StringSession) AppendAllValues() string
func (StringSession) Encode ¶
func (s StringSession) Encode() []byte
func (StringSession) EncodeToString ¶
func (s StringSession) EncodeToString() string
func (StringSession) GetAuthKey ¶
func (s StringSession) GetAuthKey() string
func (StringSession) GetAuthKeyHash ¶
func (s StringSession) GetAuthKeyHash() string
func (StringSession) GetDCID ¶
func (s StringSession) GetDCID() int
func (StringSession) SplitValues ¶
Click to show internal directories.
Click to hide internal directories.