Documentation
¶
Index ¶
- func Session(dsn string, opts ...Option) *session.AdapterSessionConstructor
- func SqliteSession(dsn string, opts ...Option) *session.AdapterSessionConstructor
- type Option
- type SQLiteAdapter
- func (s *SQLiteAdapter) AutoMigrate() error
- func (s *SQLiteAdapter) Close() error
- func (s *SQLiteAdapter) DB() *sql.DB
- func (s *SQLiteAdapter) DeleteConvState(key string) error
- func (s *SQLiteAdapter) DeleteStalePeers(olderThan int64) (int64, error)
- func (s *SQLiteAdapter) GetPeerByID(id int64) (*storage.Peer, error)
- func (s *SQLiteAdapter) GetPeerByPhoneNumber(phone string) (*storage.Peer, error)
- func (s *SQLiteAdapter) GetPeerByUsername(username string) (*storage.Peer, error)
- func (s *SQLiteAdapter) GetSession(version int) (*storage.Session, error)
- func (s *SQLiteAdapter) ListConvStates() ([]storage.ConvState, error)
- func (s *SQLiteAdapter) LoadConvState(key string) (*storage.ConvState, error)
- func (s *SQLiteAdapter) SaveConvState(state *storage.ConvState) error
- func (s *SQLiteAdapter) SavePeer(peer *storage.Peer) error
- func (s *SQLiteAdapter) UpdateSession(in *storage.Session) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SqliteSession ¶
func SqliteSession(dsn string, opts ...Option) *session.AdapterSessionConstructor
SqliteSession creates a session constructor backed by SQLite. Deprecated: use Session instead.
Types ¶
type Option ¶
type Option func(*SQLiteAdapter)
func SessionName ¶
func WithContext ¶
WithContext sets the adapter context. Deprecated: use Context instead.
type SQLiteAdapter ¶
type SQLiteAdapter struct {
// contains filtered or unexported fields
}
func NewFromDSN ¶
func NewFromDSN(dsn string, opts ...Option) (*SQLiteAdapter, error)
func (*SQLiteAdapter) AutoMigrate ¶
func (s *SQLiteAdapter) AutoMigrate() error
func (*SQLiteAdapter) Close ¶
func (s *SQLiteAdapter) Close() error
func (*SQLiteAdapter) DB ¶
func (s *SQLiteAdapter) DB() *sql.DB
func (*SQLiteAdapter) DeleteConvState ¶
func (s *SQLiteAdapter) DeleteConvState(key string) error
func (*SQLiteAdapter) DeleteStalePeers ¶
func (s *SQLiteAdapter) DeleteStalePeers(olderThan int64) (int64, error)
func (*SQLiteAdapter) GetPeerByID ¶
func (s *SQLiteAdapter) GetPeerByID(id int64) (*storage.Peer, error)
func (*SQLiteAdapter) GetPeerByPhoneNumber ¶
func (s *SQLiteAdapter) GetPeerByPhoneNumber(phone string) (*storage.Peer, error)
func (*SQLiteAdapter) GetPeerByUsername ¶
func (s *SQLiteAdapter) GetPeerByUsername(username string) (*storage.Peer, error)
func (*SQLiteAdapter) GetSession ¶
func (s *SQLiteAdapter) GetSession(version int) (*storage.Session, error)
func (*SQLiteAdapter) ListConvStates ¶
func (s *SQLiteAdapter) ListConvStates() ([]storage.ConvState, error)
func (*SQLiteAdapter) LoadConvState ¶
func (s *SQLiteAdapter) LoadConvState(key string) (*storage.ConvState, error)
func (*SQLiteAdapter) SaveConvState ¶
func (s *SQLiteAdapter) SaveConvState(state *storage.ConvState) error
func (*SQLiteAdapter) UpdateSession ¶
func (s *SQLiteAdapter) UpdateSession(in *storage.Session) error
Click to show internal directories.
Click to hide internal directories.