Documentation ¶
Overview ¶
Package storage implements storage interfaces for Stee.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingFilepath error = errors.New("cannot find parameter \"path\"")
ErrMissingFilepath happens when the filepath parameter is not passed to Open()
Functions ¶
func Register ¶
func Register(name string, factory StoreFactory) error
Register will register a new store type with its associated factory function.
Types ¶
type Store ¶
type Store interface { // Open initialize the store. (Could be opening a file or initiating a connection to a remote database) Open() error // Close closes the store. (Could be closing a file or closing a remote connection.) Close() error // ReadRedirection takes a redirection key and returns the redirection's target. ReadRedirection(key string) (target string, err error) // WriteRedirection writes a redirection to the store. Parameters are the key and the target. WriteRedirection(key string, target string) error // DeleteRedirection deletes a redirection from the store. it Takes the key as argument. DeleteRedirection(key string) error }
Store is an interface representing the possible interactions with a storage. When working with a Store, you should always open it before use and close it after use.
type StoreFactory ¶
StoreFactory if a factory function to create a new store.
func GetFactory ¶
func GetFactory(name string) (StoreFactory, error)
GetFactory returns the factory function associated with a store type.
Click to show internal directories.
Click to hide internal directories.