Documentation ¶
Index ¶
- Constants
- type EntityType
- type Peer
- type PeerStorage
- func (p *PeerStorage) AddPeer(iD, accessHash int64, peerType EntityType, userName string)
- func (p *PeerStorage) GetInputPeerById(iD int64) tg.InputPeerClass
- func (p *PeerStorage) GetInputPeerByUsername(userName string) tg.InputPeerClass
- func (p *PeerStorage) GetPeerById(iD int64) *Peer
- func (p *PeerStorage) GetPeerByUsername(username string) *Peer
- func (p *PeerStorage) GetSession() *Session
- func (p *PeerStorage) UpdateSession(session *Session)
- type Session
Constants ¶
View Source
const ( DefaultUsername = "" DefaultAccessHash = 0 )
View Source
const LatestVersion = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntityType ¶
type EntityType int
const ( TypeUser EntityType TypeChat TypeChannel )
func (EntityType) GetInt ¶
func (e EntityType) GetInt() int
type PeerStorage ¶
func NewPeerStorage ¶
func NewPeerStorage(sessionName string, inMemory bool) *PeerStorage
func (*PeerStorage) AddPeer ¶
func (p *PeerStorage) AddPeer(iD, accessHash int64, peerType EntityType, userName string)
func (*PeerStorage) GetInputPeerById ¶
func (p *PeerStorage) GetInputPeerById(iD int64) tg.InputPeerClass
GetInputPeerById finds the provided id in the peer storage and return its tg.InputPeerClass if found.
func (*PeerStorage) GetInputPeerByUsername ¶
func (p *PeerStorage) GetInputPeerByUsername(userName string) tg.InputPeerClass
GetInputPeerByUsername finds the provided username in the peer storage and return its tg.InputPeerClass if found.
func (*PeerStorage) GetPeerById ¶
func (p *PeerStorage) GetPeerById(iD int64) *Peer
GetPeerById finds the provided id in the peer storage and return it if found.
func (*PeerStorage) GetPeerByUsername ¶
func (p *PeerStorage) GetPeerByUsername(username string) *Peer
GetPeerByUsername finds the provided username in the peer storage and return it if found.
func (*PeerStorage) GetSession ¶
func (p *PeerStorage) GetSession() *Session
GetSession returns the session saved in storage.
func (*PeerStorage) UpdateSession ¶
func (p *PeerStorage) UpdateSession(session *Session)
Click to show internal directories.
Click to hide internal directories.