Documentation
¶
Overview ¶
Package redis contains redis storage.
Index ¶
- type Storage
- func (s *Storage) Close() error
- func (s *Storage) GetData(chatId, userId int64, key string, to interface{}) error
- func (s *Storage) GetState(chatId, userId int64) (fsm.State, error)
- func (s *Storage) ResetState(chatId, userId int64, withData bool) error
- func (s *Storage) SetState(chatId, userId int64, state fsm.State) error
- func (s *Storage) UpdateData(chatId, userId int64, key string, data interface{}) error
- type StorageSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage(client *redis.Client, pref StorageSettings) *Storage
NewStorage returns new redis storage.
func (*Storage) ResetState ¶
type StorageSettings ¶
type StorageSettings struct { // Prefix for records in Redis. // Default is "fsm". Prefix string // TTL for state. // Default is 0 (no ttl). TTLState time.Duration // TTL for state data. // Default is 0 (no ttl). TTLData time.Duration // Batch size for reset data. // Default is 0 (no batching). ResetDataBatchSize int64 }
Click to show internal directories.
Click to hide internal directories.