storage

package
v0.17.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPeers added in v0.5.0

func NewPeers(kv kv.KV) peers.Storage

func NewSession

func NewSession(kv kv.KV, login bool) telegram.SessionStorage

func NewState

func NewState(kv kv.KV) updates.StateStorage

Types

type Peers added in v0.5.0

type Peers struct {
	// contains filtered or unexported fields
}

func (*Peers) Find added in v0.5.0

func (p *Peers) Find(_ context.Context, _key peers.Key) (peers.Value, bool, error)

func (*Peers) FindPhone added in v0.5.0

func (p *Peers) FindPhone(ctx context.Context, phone string) (peers.Key, peers.Value, bool, error)

func (*Peers) GetContactsHash added in v0.5.0

func (p *Peers) GetContactsHash(_ context.Context) (int64, error)

func (*Peers) Save added in v0.5.0

func (p *Peers) Save(_ context.Context, _key peers.Key, value peers.Value) error

func (*Peers) SaveContactsHash added in v0.5.0

func (p *Peers) SaveContactsHash(_ context.Context, hash int64) error

func (*Peers) SavePhone added in v0.5.0

func (p *Peers) SavePhone(_ context.Context, phone string, _key peers.Key) error

type Session

type Session struct {
	// contains filtered or unexported fields
}

func (*Session) LoadSession

func (s *Session) LoadSession(_ context.Context) ([]byte, error)

func (*Session) StoreSession

func (s *Session) StoreSession(_ context.Context, data []byte) error

type State

type State struct {
	// contains filtered or unexported fields
}

func (*State) ForEachChannels

func (s *State) ForEachChannels(ctx context.Context, userID int64, f func(ctx context.Context, channelID int64, pts int) error) error

func (*State) Get

func (s *State) Get(_ context.Context, key string, v interface{}) error

func (*State) GetChannelPts

func (s *State) GetChannelPts(ctx context.Context, userID, channelID int64) (int, bool, error)

func (*State) GetState

func (s *State) GetState(ctx context.Context, userID int64) (updates.State, bool, error)

func (*State) Set

func (s *State) Set(_ context.Context, key string, v interface{}) error

func (*State) SetChannelPts

func (s *State) SetChannelPts(ctx context.Context, userID, channelID int64, pts int) error

func (*State) SetDate

func (s *State) SetDate(ctx context.Context, userID int64, date int) error

func (*State) SetDateSeq

func (s *State) SetDateSeq(ctx context.Context, userID int64, date, seq int) error

func (*State) SetPts

func (s *State) SetPts(ctx context.Context, userID int64, pts int) error

func (*State) SetQts

func (s *State) SetQts(ctx context.Context, userID int64, qts int) error

func (*State) SetSeq

func (s *State) SetSeq(ctx context.Context, userID int64, seq int) error

func (*State) SetState

func (s *State) SetState(ctx context.Context, userID int64, state updates.State) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL