Documentation
¶
Index ¶
- func Delete(collection string, key string) error
- func DeleteCollection(collection string) error
- func GetKeys(collection string) ([]string, error)
- func InitStorage(path string) error
- func Read(collection string, key string, v interface{}) error
- func SetStorage(storage Storage)
- func Write(collection string, key string, v interface{}) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCollection ¶
DeleteCollection delete all entries of a collection
func InitStorage ¶
InitStorage registers a local directory as JSON file Storage
func SetStorage ¶
func SetStorage(storage Storage)
SetStorage provide Storage to persist data for bot usage
Types ¶
type Storage ¶
type Storage interface {
Write(collection, key string, v interface{}) error
Read(collection, key string, v interface{}) error
GetKeys(collection string) ([]string, error)
Delete(collection, key string) error
}
Storage is the main interface which is used to persist bot related data (like queued messages or user histories)
func NewRedisStorage ¶
NewRedisStorage defined a redis bases storage to persist bot related information
Click to show internal directories.
Click to hide internal directories.