Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NewSessionOpts ¶
NewSessionOpts is the options for creating a new session.
type SessionName ¶
type SessionName struct { Name string FileName string Path string SessionType SessionType Data []byte Err error }
SessionName object consists of name and SessionType.
func NewSession ¶
func NewSession(sessionName string, sessionType SessionType, newSessionOpts ...NewSessionOpts) *SessionName
NewSession creates a new session with provided name string and SessionType.
func (*SessionName) GetData ¶
func (s *SessionName) GetData() ([]byte, error)
GetData is used for retrieving session data.
func (*SessionName) GetName ¶
func (s *SessionName) GetName() string
GetName is used for retrieving the name of the session.
func (*SessionName) OptimizeSessionData ¶ added in v1.1.4
func (s *SessionName) OptimizeSessionData() ([]byte, error)
OptimizeSessionData optimizes session data based on the session type.
type SessionStorage ¶
type SessionStorage struct { Session *SessionName // contains filtered or unexported fields }
SessionStorage implements SessionStorage for file system as file stored in Path.
func (*SessionStorage) LoadSession ¶
func (f *SessionStorage) LoadSession(_ context.Context) ([]byte, error)
LoadSession loads session from file.
func (*SessionStorage) StoreSession ¶
func (f *SessionStorage) StoreSession(_ context.Context, data []byte) error
StoreSession stores session to sqlite storage.
type SessionType ¶
type SessionType int
SessionType is the type of session you want to log in through.
const ( // Session should be used for authorizing into session with default settings. Session SessionType = iota // StringSession is used as SessionType when you want to log in through the string session made by gotgproto. StringSession // TelethonSession is used as SessionType when you want to log in through the string session made by telethon - a Python MTProto library. TelethonSession // PyrogramSession is used as SessionType when you want to log in through the string session made by pyrogram - a Python MTProto library. PyrogramSession // TDataSession is used as SessionType when you want to log in through the string session made by Telegram Client - a C++ MTProto library. TDataSession )
Click to show internal directories.
Click to hide internal directories.