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 ¶ added in v1.6.0
DeleteCollection delete all entries of a collection
func InitStorage ¶
InitStorage registers a local directory as JSON file Storage
func SetStorage ¶ added in v1.2.0
func SetStorage(storage Storage)
SetStorage provide Storage to persist data for bot usage
Types ¶
type Storage ¶ added in v1.6.0
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 }
func NewRedisStorage ¶ added in v1.2.0
func NewRedisStorage(client *redis.Client) Storage
NewRedisStorage defined a redis bases storage to persist bot related information
Click to show internal directories.
Click to hide internal directories.