Documentation ¶
Index ¶
Constants ¶
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" )
View Source
var (
ErrInvalidSession = errors.New("the session string is invalid/has been tampered with")
)
Functions ¶
This section is empty.
Types ¶
type Session ¶
Session 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 {
// contains filtered or unexported fields
}
func NewEmptyStringSession ¶
func NewEmptyStringSession() *StringSession
func NewStringSession ¶
func NewStringSession(authKey, authKeyHash []byte, dcID int, ipAddr string, appID int32) *StringSession
func (StringSession) AppID ¶
func (s StringSession) AppID() int32
func (StringSession) AuthKey ¶
func (s StringSession) AuthKey() []byte
func (StringSession) AuthKeyHash ¶
func (s StringSession) AuthKeyHash() []byte
func (StringSession) DcID ¶
func (s StringSession) DcID() int
func (*StringSession) Decode ¶
func (s *StringSession) Decode(encoded string) error
func (*StringSession) Encode ¶
func (s *StringSession) Encode() string
func (StringSession) IpAddr ¶
func (s StringSession) IpAddr() string
Click to show internal directories.
Click to hide internal directories.