state

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulStateDriver

type ConsulStateDriver struct {
	Client *api.Client
}

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

type ConsulStateDriverConfig struct {
	Consul api.Config
}

ConsulStateDriverConfig encapsulates the configuration parameters to initialize consul client

type EtcdStateDriver

type EtcdStateDriver struct {
	Client *etcd.Client
}

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) Deinit

func (d *EtcdStateDriver) Deinit()

Deinit is currently a no-op.

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) Deinit

func (d *FakeStateDriver) Deinit()

Deinit the driver

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL