Documentation ¶
Overview ¶
This is collection of standard storages backend.
Include each package separately to reduce number of dependencies.
It's possible to load storages by URL (if package imported) like: `Create("redis://myhost/1?key=data")`
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create new storage by looking into storages registry and mapping url parameters to configuration
Example ¶
storage, err := Create("redis://my-host") if err != nil { panic(err) } defer storage.Close()
Output:
func Register ¶
func Register(schema string, factoryFunc FactoryFunc)
Register new factory for defined schema with github.com/gorilla/schema mapper for query parameters
func RegisterWithMapper ¶
func RegisterWithMapper(schema string, factoryFunc FactoryURLFunc)
Register new factory for defined schema with custom URL mapping logic
Types ¶
type Configuration ¶
type Configuration interface { // Create new instance of storage or fail Create() (storages.Storage, error) }
Plain configuration for storage. Exported field will mapped automatically
Click to show internal directories.
Click to hide internal directories.