Documentation ¶
Overview ¶
Package storage contains the very important Shipper interface which is responsible for working with storage engines.
Index ¶
- func ConfigState(opts config.Options) (string, error)
- func CreateConfig(opts config.Options, settings map[string]interface{}) (interface{}, error)
- func Delete(opts config.Options) (config.Item, error)
- func DeleteConfig(opts config.Options) (interface{}, error)
- func Get(opts config.Options) (config.Item, error)
- func ListShippers() map[string]Shipper
- func Name(opts config.Options) string
- func Options(opts config.Options) map[string]interface{}
- func RegisterShipper(name string, shipper Shipper)
- func Update(opts config.Options) (config.Item, error)
- func UpdateConfig(opts config.Options, settings map[string]interface{}) (interface{}, error)
- func UpdateConfigVersion(opts config.Options) error
- type Shipper
- type ShipperResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigState ¶
ConfigState returns the config state (just a simple string message, could be "ACTIVE" for example)
func CreateConfig ¶
CreateConfig creates a new configuration returning success true/false along with any response and error.
func DeleteConfig ¶
DeleteConfig deletes an existing configuration
func ListShippers ¶
ListShippers returns the list of available shippers.
func RegisterShipper ¶
RegisterShipper allows anyone importing discfg into their own project to register new shippers or overwrite the defaults.
func UpdateConfig ¶
UpdateConfig updates the options/settings for a configuration (may not be implementd by each interface)
func UpdateConfigVersion ¶
UpdateConfigVersion updates the global discfg config version and modified timestamp (on the root key "/")
Types ¶
type Shipper ¶
type Shipper interface { CreateConfig(config.Options, map[string]interface{}) (interface{}, error) DeleteConfig(config.Options) (interface{}, error) UpdateConfig(config.Options, map[string]interface{}) (interface{}, error) ConfigState(config.Options) (string, error) Update(config.Options) (config.Item, error) Get(config.Options) (config.Item, error) Delete(config.Options) (config.Item, error) UpdateConfigVersion(config.Options) error Name(config.Options) string Options(config.Options) map[string]interface{} }
Shipper can send information into a database or log etc. While DynamoDB is the planned data store, who knows what will happen in the future. A simple interface never hurts.
type ShipperResult ¶
ShipperResult contains errors and other information.