Documentation ¶
Index ¶
- type ConsulStateDriver
- func (d *ConsulStateDriver) ClearState(key string) error
- func (d *ConsulStateDriver) Deinit()
- func (d *ConsulStateDriver) Init(config *core.Config) error
- func (d *ConsulStateDriver) Read(key string) ([]byte, error)
- func (d *ConsulStateDriver) ReadAll(baseKey string) ([][]byte, error)
- func (d *ConsulStateDriver) ReadAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error) ([]core.State, error)
- func (d *ConsulStateDriver) ReadState(key string, value core.State, unmarshal func([]byte, interface{}) error) error
- func (d *ConsulStateDriver) WatchAll(baseKey string, rsps chan [2][]byte) error
- func (d *ConsulStateDriver) WatchAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error, ...) error
- func (d *ConsulStateDriver) Write(key string, value []byte) error
- func (d *ConsulStateDriver) WriteState(key string, value core.State, marshal func(interface{}) ([]byte, error)) error
- type ConsulStateDriverConfig
- type EtcdStateDriver
- func (d *EtcdStateDriver) ClearState(key string) error
- func (d *EtcdStateDriver) Deinit()
- func (d *EtcdStateDriver) Init(config *core.Config) error
- func (d *EtcdStateDriver) Read(key string) ([]byte, error)
- func (d *EtcdStateDriver) ReadAll(baseKey string) ([][]byte, error)
- func (d *EtcdStateDriver) ReadAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error) ([]core.State, error)
- func (d *EtcdStateDriver) ReadState(key string, value core.State, unmarshal func([]byte, interface{}) error) error
- func (d *EtcdStateDriver) WatchAll(baseKey string, rsps chan [2][]byte) error
- func (d *EtcdStateDriver) WatchAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error, ...) error
- func (d *EtcdStateDriver) Write(key string, value []byte) error
- func (d *EtcdStateDriver) WriteState(key string, value core.State, marshal func(interface{}) ([]byte, error)) error
- type EtcdStateDriverConfig
- type FakeStateDriver
- func (d *FakeStateDriver) ClearState(key string) error
- func (d *FakeStateDriver) Deinit()
- func (d *FakeStateDriver) DumpState()
- func (d *FakeStateDriver) Init(config *core.Config) error
- func (d *FakeStateDriver) Read(key string) ([]byte, error)
- func (d *FakeStateDriver) ReadAll(baseKey string) ([][]byte, error)
- func (d *FakeStateDriver) ReadAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error) ([]core.State, error)
- func (d *FakeStateDriver) ReadState(key string, value core.State, unmarshal func([]byte, interface{}) error) error
- func (d *FakeStateDriver) WatchAll(baseKey string, rsps chan [2][]byte) error
- func (d *FakeStateDriver) WatchAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error, ...) error
- func (d *FakeStateDriver) Write(key string, value []byte) error
- func (d *FakeStateDriver) WriteState(key string, value core.State, marshal func(interface{}) ([]byte, error)) error
- type FakeStateDriverConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulStateDriver ¶
ConsulStateDriver implements the StateDriver interface for a consul based distributed key-value store used to store config and runtime state for the netplugin.
func (*ConsulStateDriver) ClearState ¶
func (d *ConsulStateDriver) ClearState(key string) error
ClearState removes key from etcd.
func (*ConsulStateDriver) Deinit ¶
func (d *ConsulStateDriver) Deinit()
Deinit is currently a no-op.
func (*ConsulStateDriver) Init ¶
func (d *ConsulStateDriver) Init(config *core.Config) error
Init the driver with a core.Config.
func (*ConsulStateDriver) Read ¶
func (d *ConsulStateDriver) Read(key string) ([]byte, error)
Read state from key.
func (*ConsulStateDriver) ReadAll ¶
func (d *ConsulStateDriver) ReadAll(baseKey string) ([][]byte, error)
ReadAll state from baseKey.
func (*ConsulStateDriver) ReadAllState ¶
func (d *ConsulStateDriver) ReadAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error) ([]core.State, error)
ReadAllState Reads all the state from baseKey and returns a list of core.State.
func (*ConsulStateDriver) ReadState ¶
func (d *ConsulStateDriver) ReadState(key string, value core.State, unmarshal func([]byte, interface{}) error) error
ReadState reads key into a core.State with the unmarshalling function.
func (*ConsulStateDriver) WatchAll ¶
func (d *ConsulStateDriver) WatchAll(baseKey string, rsps chan [2][]byte) error
WatchAll state transitions from baseKey
func (*ConsulStateDriver) WatchAllState ¶
func (d *ConsulStateDriver) WatchAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error, rsps chan core.WatchState) error
WatchAllState watches all state from the baseKey.
func (*ConsulStateDriver) Write ¶
func (d *ConsulStateDriver) Write(key string, value []byte) error
Write state to key with value.
func (*ConsulStateDriver) WriteState ¶
func (d *ConsulStateDriver) WriteState(key string, value core.State, marshal func(interface{}) ([]byte, error)) error
WriteState writes a value of core.State into a key with a given marshalling function.
type ConsulStateDriverConfig ¶
ConsulStateDriverConfig encapsulates the configuration parameters to initialize consul client
type EtcdStateDriver ¶
EtcdStateDriver implements the StateDriver interface for an etcd based distributed key-value store used to store config and runtime state for the netplugin.
func (*EtcdStateDriver) ClearState ¶
func (d *EtcdStateDriver) ClearState(key string) error
ClearState removes key from etcd.
func (*EtcdStateDriver) Init ¶
func (d *EtcdStateDriver) Init(config *core.Config) error
Init the driver with a core.Config.
func (*EtcdStateDriver) Read ¶
func (d *EtcdStateDriver) Read(key string) ([]byte, error)
Read state from key.
func (*EtcdStateDriver) ReadAll ¶
func (d *EtcdStateDriver) ReadAll(baseKey string) ([][]byte, error)
ReadAll state from baseKey.
func (*EtcdStateDriver) ReadAllState ¶
func (d *EtcdStateDriver) ReadAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error) ([]core.State, error)
ReadAllState Reads all the state from baseKey and returns a list of core.State.
func (*EtcdStateDriver) ReadState ¶
func (d *EtcdStateDriver) ReadState(key string, value core.State, unmarshal func([]byte, interface{}) error) error
ReadState reads key into a core.State with the unmarshalling function.
func (*EtcdStateDriver) WatchAll ¶
func (d *EtcdStateDriver) WatchAll(baseKey string, rsps chan [2][]byte) error
WatchAll state transitions from baseKey
func (*EtcdStateDriver) WatchAllState ¶
func (d *EtcdStateDriver) WatchAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error, rsps chan core.WatchState) error
WatchAllState watches all state from the baseKey.
func (*EtcdStateDriver) Write ¶
func (d *EtcdStateDriver) Write(key string, value []byte) error
Write state to key with value.
func (*EtcdStateDriver) WriteState ¶
func (d *EtcdStateDriver) WriteState(key string, value core.State, marshal func(interface{}) ([]byte, error)) error
WriteState writes a value of core.State into a key with a given marshalling function.
type EtcdStateDriverConfig ¶
type EtcdStateDriverConfig struct { Etcd struct { Machines []string } }
EtcdStateDriverConfig encapsulates the etcd endpoints used to communicate with it.
type FakeStateDriver ¶
type FakeStateDriver struct {
TestState map[string]valueData
}
FakeStateDriver implements core.StateDriver interface for use with unit-tests
func (*FakeStateDriver) ClearState ¶
func (d *FakeStateDriver) ClearState(key string) error
ClearState clears key
func (*FakeStateDriver) DumpState ¶
func (d *FakeStateDriver) DumpState()
DumpState is a debugging tool.
func (*FakeStateDriver) Init ¶
func (d *FakeStateDriver) Init(config *core.Config) error
Init the driver
func (*FakeStateDriver) Read ¶
func (d *FakeStateDriver) Read(key string) ([]byte, error)
Read value from key
func (*FakeStateDriver) ReadAll ¶
func (d *FakeStateDriver) ReadAll(baseKey string) ([][]byte, error)
ReadAll values from baseKey
func (*FakeStateDriver) ReadAllState ¶
func (d *FakeStateDriver) ReadAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error) ([]core.State, error)
ReadAllState reads all state from baseKey of a given type
func (*FakeStateDriver) ReadState ¶
func (d *FakeStateDriver) ReadState(key string, value core.State, unmarshal func([]byte, interface{}) error) error
ReadState unmarshals state into a core.State
func (*FakeStateDriver) WatchAll ¶
func (d *FakeStateDriver) WatchAll(baseKey string, rsps chan [2][]byte) error
WatchAll values from baseKey
func (*FakeStateDriver) WatchAllState ¶
func (d *FakeStateDriver) WatchAllState(baseKey string, sType core.State, unmarshal func([]byte, interface{}) error, rsps chan core.WatchState) error
WatchAllState reads all state from baseKey of a given type
func (*FakeStateDriver) Write ¶
func (d *FakeStateDriver) Write(key string, value []byte) error
Write value to key
func (*FakeStateDriver) WriteState ¶
func (d *FakeStateDriver) WriteState(key string, value core.State, marshal func(interface{}) ([]byte, error)) error
WriteState writes a core.State to key.
type FakeStateDriverConfig ¶
type FakeStateDriverConfig struct{}
FakeStateDriverConfig represents the configuration of the fake statedriver, which is an empty struct.