Documentation ¶
Index ¶
- Constants
- type Redis
- func (r *Redis) DefaultWasSet(chatID int64) (bool, error)
- func (r *Redis) DeleteBucket(chatID int64, bucketName string) error
- func (r *Redis) DeleteOption(chatID int64, bucketName string, optionIdx int64) ([]domain.Option, error)
- func (r *Redis) Exists(chatID int64, bucketName string) (bool, error)
- func (r *Redis) GetAllBuckets(chatID int64) ([]domain.Bucket, error)
- func (r *Redis) GetDefaultBucket(chatID int64) (string, error)
- func (r *Redis) InsertBucket(chatID int64, name string) error
- func (r *Redis) InsertOption(chatID int64, bucketName string, option domain.Option) error
- func (r *Redis) ReadAllOptions(chatID int64, bucketName string) ([]domain.Option, error)
- func (r *Redis) UpdateDefaultBucket(chatID int64, bucketName string) error
Constants ¶
View Source
const BucketNameSeparator = " - "
BucketNameSeparator string used for concatting chatID with user defined name to form bucket names
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
Redis abstraction for redis database
func NewInstance ¶
NewInstance get new instance of Redis database
func (*Redis) DefaultWasSet ¶
DefaultWasSet check if a default bucket set for a chat
func (*Redis) DeleteBucket ¶
DeleteBucket remove a bucket from database
func (*Redis) DeleteOption ¶
func (r *Redis) DeleteOption(chatID int64, bucketName string, optionIdx int64) ([]domain.Option, error)
DeleteOption remove an option from a bucket
func (*Redis) GetAllBuckets ¶
GetAllBuckets get all buckets in a chat
func (*Redis) GetDefaultBucket ¶
GetDefaultBucket get the default bucket of current chat
func (*Redis) InsertBucket ¶
InsertBucket create a new options bucket
func (*Redis) InsertOption ¶
InsertOption put an option inside a bucket
func (*Redis) ReadAllOptions ¶
ReadAllOptions query all options inside a bucket
Click to show internal directories.
Click to hide internal directories.