Documentation ¶
Index ¶
Constants ¶
View Source
const (
InMemorySessionName = ":memory:"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SessionName ¶
type SessionName struct {
// contains filtered or unexported fields
}
SessionName object consists of name and SessionType.
func NewInMemorySession ¶
func NewInMemorySession(sessionName string, sessionType SessionType) *SessionName
NewInMemorySession Used for create Session with in memory type
func NewSession ¶
func NewSession(sessionName string, sessionType SessionType) *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 through provided SessionName type.
func (*SessionName) GetName ¶
func (s *SessionName) GetName() string
GetName is used for retrieving name of the session.
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. It consists of three types: Session, StringSession, TelethonSession.
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 )
Click to show internal directories.
Click to hide internal directories.