Documentation ¶
Overview ¶
Package backend is a generated protocol buffer package.
It is generated from these files:
test.proto
It has these top-level messages:
Timestamp
Index ¶
- Constants
- Variables
- func Filter(pb proto.Message, field string, cb func(reflect.Value))
- type BackendConnection
- type Bolt
- func (b *Bolt) Close() error
- func (b *Bolt) Connect(dest ConnectionAddress) error
- func (b *Bolt) Create(key string, value []byte) error
- func (b *Bolt) CreateWithID(key string, value []byte) (string, error)
- func (b *Bolt) Delete(key string) error
- func (b *Bolt) Find(key string) ([]byte, error)
- func (b *Bolt) FindLastKey(prefixKey string) (string, error)
- func (b *Bolt) Keys(parentKey string) (KeyIterator, error)
- func (b *Bolt) Update(key string, value []byte) error
- type BoltDBPath
- type ClusterBackend
- type ConnectionAddress
- type KeyIterator
- type MockClusterBackend
- type ModelBackend
- type ModelSchema
- type ModelWatcher
- type ProtoClusterBackend
- type ProtoClusterWrapper
- type ProtoFilter
- type ProtoModelBackend
- type ProtoWrapper
- func (p *ProtoWrapper) AddFilter(f ProtoFilter)
- func (p *ProtoWrapper) Backend() ModelBackend
- func (p *ProtoWrapper) Create(key string, value proto.Message) error
- func (p *ProtoWrapper) CreateWithID(key string, value proto.Message) (string, error)
- func (p *ProtoWrapper) Delete(key string) error
- func (p *ProtoWrapper) Find(key string, v proto.Message) error
- func (p *ProtoWrapper) FindLastKey(prefixKey string) (string, error)
- func (p *ProtoWrapper) Keys(parentKey string) (KeyIterator, error)
- func (p *ProtoWrapper) Update(key string, value proto.Message) error
- func (p *ProtoWrapper) Watch(key string) (WatchEvent, error)
- type SchemaHandler
- type Timestamp
- type TimestampFilter
- type WatchEvent
- type Zk
- func (z *Zk) Close() error
- func (z *Zk) Connect(dest ConnectionAddress) error
- func (z *Zk) Create(key string, value []byte) error
- func (z *Zk) CreateWithID(key string, value []byte) (string, error)
- func (z *Zk) Delete(key string) error
- func (z *Zk) Find(key string) ([]byte, error)
- func (z *Zk) FindLastKey(prefixKey string) (string, error)
- func (z *Zk) Keys(parentKey string) (KeyIterator, error)
- func (z *Zk) Schema() SchemaHandler
- func (z *Zk) Update(key string, value []byte) error
- func (z *Zk) Watch(key string) (WatchEvent, error)
- type ZkCluster
- func (z *ZkCluster) Close() error
- func (z *ZkCluster) Connect(dest ConnectionAddress) error
- func (z *ZkCluster) Find(key string) (value []byte, err error)
- func (z *ZkCluster) Register(key string, value []byte) error
- func (z *ZkCluster) Schema() SchemaHandler
- func (z *ZkCluster) UnRegister(key string) error
- type ZkEndpoint
Constants ¶
View Source
const DefaultBasePath = "/openvdc"
Variables ¶
View Source
var ErrConnectionExists = errors.New("Connection is established")
View Source
var ErrConnectionNotReady = errors.New("Connection is not established yet.")
View Source
var ErrFindLastKey = func(key string) error { return fmt.Errorf("Unable to find znode with last key: %s", key) }
View Source
var ErrUnknownKey = func(key string) error { return errors.New("Unknown key name: " + key) }
Functions ¶
Types ¶
type BackendConnection ¶
type BackendConnection interface { Connect(dest ConnectionAddress) error Close() error }
type Bolt ¶
type Bolt struct {
// contains filtered or unexported fields
}
func NewBoltBackend ¶
func NewBoltBackend() *Bolt
func (*Bolt) Connect ¶
func (b *Bolt) Connect(dest ConnectionAddress) error
type BoltDBPath ¶
type BoltDBPath string
func (BoltDBPath) String ¶
func (b BoltDBPath) String() string
type ClusterBackend ¶
type ConnectionAddress ¶
type ConnectionAddress interface {
// contains filtered or unexported methods
}
type KeyIterator ¶
type MockClusterBackend ¶
type MockClusterBackend struct{}
func (*MockClusterBackend) Close ¶
func (m *MockClusterBackend) Close() error
func (*MockClusterBackend) Connect ¶
func (m *MockClusterBackend) Connect(dest []string) error
type ModelBackend ¶
type ModelBackend interface { BackendConnection Create(key string, value []byte) error CreateWithID(key string, value []byte) (string, error) Update(key string, value []byte) error Find(key string) ([]byte, error) Delete(key string) error Keys(parentKey string) (KeyIterator, error) FindLastKey(prefixKey string) (string, error) }
type ModelSchema ¶
type ModelSchema interface {
Schema() SchemaHandler
}
type ModelWatcher ¶
type ModelWatcher interface {
Watch(key string) (WatchEvent, error)
}
type ProtoClusterBackend ¶
type ProtoClusterBackend interface { Backend() ClusterBackend Register(nodeID string, value proto.Message) error Find(nodeID string, value proto.Message) error Unregister(nodeID string) error }
ProtoClusterBackend is the ClusterBackend interface wrapper that accepts proto.Message instead of raw bytes.
func NewProtoClusterWrapper ¶
func NewProtoClusterWrapper(bk ClusterBackend) ProtoClusterBackend
type ProtoClusterWrapper ¶
type ProtoClusterWrapper struct {
// contains filtered or unexported fields
}
func (*ProtoClusterWrapper) Backend ¶
func (p *ProtoClusterWrapper) Backend() ClusterBackend
func (*ProtoClusterWrapper) Find ¶
func (p *ProtoClusterWrapper) Find(nodeID string, v proto.Message) error
func (*ProtoClusterWrapper) Register ¶
func (p *ProtoClusterWrapper) Register(key string, value proto.Message) error
func (*ProtoClusterWrapper) Unregister ¶
func (p *ProtoClusterWrapper) Unregister(nodeID string) error
type ProtoFilter ¶
type ProtoModelBackend ¶
type ProtoModelBackend interface { Backend() ModelBackend AddFilter(f ProtoFilter) Create(key string, value proto.Message) error CreateWithID(key string, value proto.Message) (string, error) Update(key string, value proto.Message) error Find(key string, v proto.Message) error Delete(key string) error Keys(parentKey string) (KeyIterator, error) FindLastKey(prefixKey string) (string, error) ModelWatcher }
ProtoModelBackend is the ModelBackend interface wrapper that accepts proto.Message instead of raw bytes.
func NewProtoWrapper ¶
func NewProtoWrapper(bk ModelBackend) ProtoModelBackend
type ProtoWrapper ¶
type ProtoWrapper struct {
// contains filtered or unexported fields
}
func (*ProtoWrapper) AddFilter ¶
func (p *ProtoWrapper) AddFilter(f ProtoFilter)
func (*ProtoWrapper) Backend ¶
func (p *ProtoWrapper) Backend() ModelBackend
func (*ProtoWrapper) CreateWithID ¶
func (*ProtoWrapper) Delete ¶
func (p *ProtoWrapper) Delete(key string) error
func (*ProtoWrapper) FindLastKey ¶
func (p *ProtoWrapper) FindLastKey(prefixKey string) (string, error)
func (*ProtoWrapper) Keys ¶
func (p *ProtoWrapper) Keys(parentKey string) (KeyIterator, error)
func (*ProtoWrapper) Watch ¶
func (p *ProtoWrapper) Watch(key string) (WatchEvent, error)
type SchemaHandler ¶
type Timestamp ¶
type Timestamp struct { CreatedAt *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=created_at,json=createdAt" json:"created_at,omitempty"` UpdatedAt *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt" json:"updated_at,omitempty"` }
func (*Timestamp) Descriptor ¶
func (*Timestamp) GetCreatedAt ¶
func (m *Timestamp) GetCreatedAt() *google_protobuf.Timestamp
func (*Timestamp) GetUpdatedAt ¶
func (m *Timestamp) GetUpdatedAt() *google_protobuf.Timestamp
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()
type TimestampFilter ¶
type WatchEvent ¶
type WatchEvent int
const ( EventErr WatchEvent = iota EventUnknown EventCreated EventDeleted EventModified )
func (WatchEvent) String ¶
func (e WatchEvent) String() string
type Zk ¶
type Zk struct {
// contains filtered or unexported fields
}
func NewZkBackend ¶
func NewZkBackend() *Zk
func (*Zk) Connect ¶
func (z *Zk) Connect(dest ConnectionAddress) error
func (*Zk) Schema ¶
func (z *Zk) Schema() SchemaHandler
type ZkCluster ¶
type ZkCluster struct {
// contains filtered or unexported fields
}
func NewZkClusterBackend ¶
func NewZkClusterBackend() *ZkCluster
func (*ZkCluster) Connect ¶
func (z *ZkCluster) Connect(dest ConnectionAddress) error
func (*ZkCluster) Schema ¶
func (z *ZkCluster) Schema() SchemaHandler
func (*ZkCluster) UnRegister ¶
type ZkEndpoint ¶
Implements pflag.Value and backend.ConnectionAddress
func (*ZkEndpoint) Set ¶
func (ze *ZkEndpoint) Set(value string) error
func (*ZkEndpoint) String ¶
func (ze *ZkEndpoint) String() string
func (ZkEndpoint) Type ¶
func (ZkEndpoint) Type() string
Click to show internal directories.
Click to hide internal directories.