Documentation ¶
Overview ¶
Package mock provides a mock storage Shipper interface for tests.
Index ¶
- Variables
- type MockShipper
- func (m MockShipper) ConfigState(opts config.Options) (string, error)
- func (m MockShipper) CreateConfig(opts config.Options, settings map[string]interface{}) (interface{}, error)
- func (m MockShipper) Delete(opts config.Options) (config.Item, error)
- func (m MockShipper) DeleteConfig(opts config.Options) (interface{}, error)
- func (m MockShipper) Get(opts config.Options) (config.Item, error)
- func (m MockShipper) Name(opts config.Options) string
- func (m MockShipper) Options(opts config.Options) map[string]interface{}
- func (m MockShipper) Update(opts config.Options) (config.Item, error)
- func (m MockShipper) UpdateConfig(opts config.Options, settings map[string]interface{}) (interface{}, error)
- func (m MockShipper) UpdateConfigVersion(opts config.Options) error
Constants ¶
This section is empty.
Variables ¶
View Source
var MockCfg = map[string]map[string]config.Item{ "mockcfg": { "/": config.Item{ Key: "/", Value: []byte("Mock configuration"), CfgVersion: int64(4), CfgModifiedNanoseconds: int64(1464675792991825937), }, "initial": config.Item{ Key: "initial", Value: []byte("initial value for test"), Version: int64(1), }, "initial_second": config.Item{ Key: "initial_second", Value: []byte("a second initial value for test"), Version: int64(3), }, "json_value": config.Item{ Key: "initial_second", Value: []byte(`{"json": "string", "num": 4}`), Version: int64(3), }, "encoded": config.Item{ Key: "encoded", Value: []byte(`eyJ1cGRhdGVkIjogImZyaWRheSJ9`), Version: int64(1), }, }, }
MockCfg is just a map of mock records within a mock config.
Functions ¶
This section is empty.
Types ¶
type MockShipper ¶
type MockShipper struct { }
MockShipper struct implements the Shipper interface for testing purposes.
func (MockShipper) ConfigState ¶
func (m MockShipper) ConfigState(opts config.Options) (string, error)
ConfigState returns the state of the config
func (MockShipper) CreateConfig ¶
func (m MockShipper) CreateConfig(opts config.Options, settings map[string]interface{}) (interface{}, error)
CreateConfig creates a config
func (MockShipper) DeleteConfig ¶
func (m MockShipper) DeleteConfig(opts config.Options) (interface{}, error)
DeleteConfig deletes a config
func (MockShipper) Name ¶
func (m MockShipper) Name(opts config.Options) string
Name returns the name for the interface
func (MockShipper) Options ¶
func (m MockShipper) Options(opts config.Options) map[string]interface{}
Options returns various settings and options for the shipper
func (MockShipper) UpdateConfig ¶
func (m MockShipper) UpdateConfig(opts config.Options, settings map[string]interface{}) (interface{}, error)
UpdateConfig updates a config
func (MockShipper) UpdateConfigVersion ¶
func (m MockShipper) UpdateConfigVersion(opts config.Options) error
UpdateConfigVersion updates the incremental counter/state of a configuration and should be called on each change
Click to show internal directories.
Click to hide internal directories.