Documentation
¶
Index ¶
Constants ¶
const KeysTable = "keys"
Variables ¶
This section is empty.
Functions ¶
func Memory ¶
Memory is a joe.Option which is supposed to be passed to joe.New(…) to configure a new bot. The dsn is passed to Sqlite to open the DB. This could be a path to a file or in-memory DB:
https://godoc.org/github.com/mattn/go-sqlite3#SQLiteDriver.Open
If the DB already exists it will be opened, otherwise it will be created and initialised. If the file exists but cannot be opened its error will be deferred until the bot is actually started via its Run() function.
Example usage:
b := joe.New("example", sqlite.Memory(":memory:"), … )
Types ¶
type Option ¶
type Option func(*memory) error
Option corresponds to a configuration setting of the file memory. All available options are the exported functions of this package that share the prefix "With" in their names.
func WithLogger ¶
WithLogger is a memory option that allows the caller to set a different logger. By default this option is not required because the file.Memory(…) function automatically uses the logger of the given joe.Config.