Documentation ¶
Index ¶
- Constants
- Variables
- func GetLockPath(path string) string
- func ValidateOpts(kvStore string, kvStoreOpts map[string]string, supportedOpts map[string]bool) error
- type ConsulClient
- func (c *ConsulClient) DeleteTree(path string) error
- func (c *ConsulClient) GASNewL3n4AddrID(basePath string, baseID uint32, lAddrID *types.L3n4AddrID) error
- func (c *ConsulClient) GASNewSecLabelID(basePath string, baseID uint32, pI *policy.Identity) error
- func (c *ConsulClient) GetMaxID(key string, firstID uint32) (uint32, error)
- func (c *ConsulClient) GetValue(k string) (json.RawMessage, error)
- func (c *ConsulClient) GetWatcher(key string, timeSleep time.Duration) <-chan []policy.NumericIdentity
- func (c *ConsulClient) InitializeFreeID(path string, firstID uint32) error
- func (c *ConsulClient) LockPath(path string) (KVLocker, error)
- func (c *ConsulClient) SetMaxID(key string, firstID, maxID uint32) error
- func (c *ConsulClient) SetValue(k string, v interface{}) error
- func (c *ConsulClient) Status() (string, error)
- type EtcdClient
- func (e *EtcdClient) DeleteTree(path string) error
- func (e *EtcdClient) GASNewL3n4AddrID(basePath string, baseID uint32, lAddrID *types.L3n4AddrID) error
- func (e *EtcdClient) GASNewSecLabelID(basePath string, baseID uint32, pI *policy.Identity) error
- func (e *EtcdClient) GetMaxID(key string, firstID uint32) (uint32, error)
- func (e *EtcdClient) GetValue(k string) (json.RawMessage, error)
- func (e *EtcdClient) GetWatcher(key string, timeSleep time.Duration) <-chan []policy.NumericIdentity
- func (e *EtcdClient) InitializeFreeID(path string, firstID uint32) error
- func (e *EtcdClient) LockPath(path string) (KVLocker, error)
- func (e *EtcdClient) SetMaxID(key string, firstID, maxID uint32) error
- func (e *EtcdClient) SetValue(k string, v interface{}) error
- func (e *EtcdClient) Status() (string, error)
- type EtcdLocker
- type KVClient
- type KVLocker
- type LocalClient
- func (l *LocalClient) DeleteTree(path string) error
- func (l *LocalClient) GASNewL3n4AddrID(basePath string, baseID uint32, lAddrID *types.L3n4AddrID) error
- func (l *LocalClient) GASNewSecLabelID(basePath string, baseID uint32, pI *policy.Identity) error
- func (l *LocalClient) GetMaxID(key string, firstID uint32) (uint32, error)
- func (l *LocalClient) GetValue(k string) (json.RawMessage, error)
- func (l *LocalClient) GetWatcher(key string, timeSleep time.Duration) <-chan []policy.NumericIdentity
- func (l *LocalClient) InitializeFreeID(path string, firstID uint32) error
- func (l *LocalClient) LockPath(path string) (KVLocker, error)
- func (l *LocalClient) SetMaxID(key string, firstID, maxID uint32) error
- func (l *LocalClient) SetValue(k string, v interface{}) error
- func (l *LocalClient) Status() (string, error)
- type LocalLocker
Constants ¶
const ( // EAddr is the string representing the key mapping to the value of the // address for Etcd. EAddr = "etcd.address" // ECfg is the string representing the key mapping to the path of the // configuration for Etcd. ECfg = "etcd.config" )
const ( Local = "local" Consul = "consul" Etcd = "etcd" )
Supported key-value store types.
const ( // CAddr is the string representing the key mapping to the value of the // address for Consul. CAddr = "consul.address" )
Variables ¶
var ConsulOpts = map[string]bool{ CAddr: true, }
/ ConsulOpts is the set of supported options for Consul configuration.
EtcdOpts is the set of supported options for Etcd configuration.
Functions ¶
func GetLockPath ¶
GetLockPath returns the lock path representation of the given path.
Types ¶
type ConsulClient ¶
func (*ConsulClient) DeleteTree ¶
func (c *ConsulClient) DeleteTree(path string) error
func (*ConsulClient) GASNewL3n4AddrID ¶
func (c *ConsulClient) GASNewL3n4AddrID(basePath string, baseID uint32, lAddrID *types.L3n4AddrID) error
func (*ConsulClient) GASNewSecLabelID ¶
func (*ConsulClient) GetMaxID ¶
func (c *ConsulClient) GetMaxID(key string, firstID uint32) (uint32, error)
GetMaxID returns the maximum possible free UUID stored in consul.
func (*ConsulClient) GetValue ¶
func (c *ConsulClient) GetValue(k string) (json.RawMessage, error)
func (*ConsulClient) GetWatcher ¶
func (c *ConsulClient) GetWatcher(key string, timeSleep time.Duration) <-chan []policy.NumericIdentity
GetWatcher watches for kvstore changes in the given key. Triggers the returned channel every time the key path is changed. FIXME This function is highly tightened to the maxFreeID, change name accordingly
func (*ConsulClient) InitializeFreeID ¶
func (c *ConsulClient) InitializeFreeID(path string, firstID uint32) error
func (*ConsulClient) SetMaxID ¶
func (c *ConsulClient) SetMaxID(key string, firstID, maxID uint32) error
func (*ConsulClient) SetValue ¶
func (c *ConsulClient) SetValue(k string, v interface{}) error
func (*ConsulClient) Status ¶
func (c *ConsulClient) Status() (string, error)
type EtcdClient ¶
type EtcdClient struct {
// contains filtered or unexported fields
}
func (*EtcdClient) DeleteTree ¶
func (e *EtcdClient) DeleteTree(path string) error
func (*EtcdClient) GASNewL3n4AddrID ¶
func (e *EtcdClient) GASNewL3n4AddrID(basePath string, baseID uint32, lAddrID *types.L3n4AddrID) error
GASNewL3n4AddrID gets the next available ServiceID and sets it in lAddrID. After assigning the ServiceID to lAddrID it sets the ServiceID + 1 in common.LastFreeServiceIDKeyPath path.
func (*EtcdClient) GASNewSecLabelID ¶
GASNewSecLabelID gets the next available LabelID and sets it in id. After assigning the LabelID to id it sets the LabelID + 1 in common.LastFreeLabelIDKeyPath path.
func (*EtcdClient) GetMaxID ¶
func (e *EtcdClient) GetMaxID(key string, firstID uint32) (uint32, error)
func (*EtcdClient) GetValue ¶
func (e *EtcdClient) GetValue(k string) (json.RawMessage, error)
func (*EtcdClient) GetWatcher ¶
func (e *EtcdClient) GetWatcher(key string, timeSleep time.Duration) <-chan []policy.NumericIdentity
GetWatcher watches for kvstore changes in the given key. Triggers the returned channel every time the key path is changed. FIXME This function is highly tightened to the maxFreeID, change name accordingly
func (*EtcdClient) InitializeFreeID ¶
func (e *EtcdClient) InitializeFreeID(path string, firstID uint32) error
func (*EtcdClient) SetMaxID ¶
func (e *EtcdClient) SetMaxID(key string, firstID, maxID uint32) error
func (*EtcdClient) SetValue ¶
func (e *EtcdClient) SetValue(k string, v interface{}) error
func (*EtcdClient) Status ¶
func (e *EtcdClient) Status() (string, error)
type EtcdLocker ¶
type EtcdLocker struct {
// contains filtered or unexported fields
}
func (*EtcdLocker) Unlock ¶
func (e *EtcdLocker) Unlock() error
type KVClient ¶
type KVClient interface { LockPath(path string) (KVLocker, error) GetValue(k string) (json.RawMessage, error) SetValue(k string, v interface{}) error InitializeFreeID(path string, firstID uint32) error GetMaxID(key string, firstID uint32) (uint32, error) SetMaxID(key string, firstID, maxID uint32) error GASNewSecLabelID(baseKeyPath string, baseID uint32, secCtxLabels *policy.Identity) error GASNewL3n4AddrID(basePath string, baseID uint32, lAddrID *types.L3n4AddrID) error DeleteTree(path string) error GetWatcher(key string, timeSleep time.Duration) <-chan []policy.NumericIdentity Status() (string, error) }
func NewLocalClient ¶
func NewLocalClient() KVClient
type LocalClient ¶
type LocalClient struct {
// contains filtered or unexported fields
}
func (*LocalClient) DeleteTree ¶
func (l *LocalClient) DeleteTree(path string) error
func (*LocalClient) GASNewL3n4AddrID ¶
func (l *LocalClient) GASNewL3n4AddrID(basePath string, baseID uint32, lAddrID *types.L3n4AddrID) error
func (*LocalClient) GASNewSecLabelID ¶
func (*LocalClient) GetMaxID ¶
func (l *LocalClient) GetMaxID(key string, firstID uint32) (uint32, error)
func (*LocalClient) GetValue ¶
func (l *LocalClient) GetValue(k string) (json.RawMessage, error)
func (*LocalClient) GetWatcher ¶
func (l *LocalClient) GetWatcher(key string, timeSleep time.Duration) <-chan []policy.NumericIdentity
func (*LocalClient) InitializeFreeID ¶
func (l *LocalClient) InitializeFreeID(path string, firstID uint32) error
func (*LocalClient) SetMaxID ¶
func (l *LocalClient) SetMaxID(key string, firstID, maxID uint32) error
func (*LocalClient) SetValue ¶
func (l *LocalClient) SetValue(k string, v interface{}) error
func (*LocalClient) Status ¶
func (l *LocalClient) Status() (string, error)
type LocalLocker ¶
type LocalLocker struct { }
func (*LocalLocker) Unlock ¶
func (l *LocalLocker) Unlock() error