Documentation ¶
Overview ¶
Package kv is a generated GoMock package.
Index ¶
- Constants
- Variables
- type CompareType
- type Condition
- type MockCondition
- func (m *MockCondition) CompareType() CompareType
- func (m *MockCondition) EXPECT() *MockConditionMockRecorder
- func (m *MockCondition) Key() string
- func (m *MockCondition) SetCompareType(t CompareType) Condition
- func (m *MockCondition) SetKey(key string) Condition
- func (m *MockCondition) SetTargetType(t TargetType) Condition
- func (m *MockCondition) SetValue(value interface{}) Condition
- func (m *MockCondition) TargetType() TargetType
- func (m *MockCondition) Value() interface{}
- type MockConditionMockRecorder
- func (mr *MockConditionMockRecorder) CompareType() *gomock.Call
- func (mr *MockConditionMockRecorder) Key() *gomock.Call
- func (mr *MockConditionMockRecorder) SetCompareType(t interface{}) *gomock.Call
- func (mr *MockConditionMockRecorder) SetKey(key interface{}) *gomock.Call
- func (mr *MockConditionMockRecorder) SetTargetType(t interface{}) *gomock.Call
- func (mr *MockConditionMockRecorder) SetValue(value interface{}) *gomock.Call
- func (mr *MockConditionMockRecorder) TargetType() *gomock.Call
- func (mr *MockConditionMockRecorder) Value() *gomock.Call
- type MockOp
- type MockOpMockRecorder
- type MockOpResponse
- func (m *MockOpResponse) EXPECT() *MockOpResponseMockRecorder
- func (m *MockOpResponse) Key() string
- func (m *MockOpResponse) SetKey(key string) Op
- func (m *MockOpResponse) SetType(ot OpType) Op
- func (m *MockOpResponse) SetValue(v interface{}) OpResponse
- func (m *MockOpResponse) Type() OpType
- func (m *MockOpResponse) Value() interface{}
- type MockOpResponseMockRecorder
- func (mr *MockOpResponseMockRecorder) Key() *gomock.Call
- func (mr *MockOpResponseMockRecorder) SetKey(key interface{}) *gomock.Call
- func (mr *MockOpResponseMockRecorder) SetType(ot interface{}) *gomock.Call
- func (mr *MockOpResponseMockRecorder) SetValue(v interface{}) *gomock.Call
- func (mr *MockOpResponseMockRecorder) Type() *gomock.Call
- func (mr *MockOpResponseMockRecorder) Value() *gomock.Call
- type MockOverrideOptions
- func (m *MockOverrideOptions) EXPECT() *MockOverrideOptionsMockRecorder
- func (m *MockOverrideOptions) Environment() string
- func (m *MockOverrideOptions) Namespace() string
- func (m *MockOverrideOptions) SetEnvironment(env string) OverrideOptions
- func (m *MockOverrideOptions) SetNamespace(namespace string) OverrideOptions
- func (m *MockOverrideOptions) SetZone(value string) OverrideOptions
- func (m *MockOverrideOptions) Validate() error
- func (m *MockOverrideOptions) Zone() string
- type MockOverrideOptionsMockRecorder
- func (mr *MockOverrideOptionsMockRecorder) Environment() *gomock.Call
- func (mr *MockOverrideOptionsMockRecorder) Namespace() *gomock.Call
- func (mr *MockOverrideOptionsMockRecorder) SetEnvironment(env interface{}) *gomock.Call
- func (mr *MockOverrideOptionsMockRecorder) SetNamespace(namespace interface{}) *gomock.Call
- func (mr *MockOverrideOptionsMockRecorder) SetZone(value interface{}) *gomock.Call
- func (mr *MockOverrideOptionsMockRecorder) Validate() *gomock.Call
- func (mr *MockOverrideOptionsMockRecorder) Zone() *gomock.Call
- type MockResponse
- type MockResponseMockRecorder
- type MockStore
- func (m *MockStore) CheckAndSet(key string, version int, v proto.Message) (int, error)
- func (m *MockStore) Delete(key string) (Value, error)
- func (m *MockStore) EXPECT() *MockStoreMockRecorder
- func (m *MockStore) Get(key string) (Value, error)
- func (m *MockStore) History(key string, from, to int) ([]Value, error)
- func (m *MockStore) Set(key string, v proto.Message) (int, error)
- func (m *MockStore) SetIfNotExists(key string, v proto.Message) (int, error)
- func (m *MockStore) Watch(key string) (ValueWatch, error)
- type MockStoreMockRecorder
- func (mr *MockStoreMockRecorder) CheckAndSet(key, version, v interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) Delete(key interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) Get(key interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) History(key, from, to interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) Set(key, v interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) SetIfNotExists(key, v interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) Watch(key interface{}) *gomock.Call
- type MockTxnStore
- func (m *MockTxnStore) CheckAndSet(key string, version int, v proto.Message) (int, error)
- func (m *MockTxnStore) Commit(arg0 []Condition, arg1 []Op) (Response, error)
- func (m *MockTxnStore) Delete(key string) (Value, error)
- func (m *MockTxnStore) EXPECT() *MockTxnStoreMockRecorder
- func (m *MockTxnStore) Get(key string) (Value, error)
- func (m *MockTxnStore) History(key string, from, to int) ([]Value, error)
- func (m *MockTxnStore) Set(key string, v proto.Message) (int, error)
- func (m *MockTxnStore) SetIfNotExists(key string, v proto.Message) (int, error)
- func (m *MockTxnStore) Watch(key string) (ValueWatch, error)
- type MockTxnStoreMockRecorder
- func (mr *MockTxnStoreMockRecorder) CheckAndSet(key, version, v interface{}) *gomock.Call
- func (mr *MockTxnStoreMockRecorder) Commit(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockTxnStoreMockRecorder) Delete(key interface{}) *gomock.Call
- func (mr *MockTxnStoreMockRecorder) Get(key interface{}) *gomock.Call
- func (mr *MockTxnStoreMockRecorder) History(key, from, to interface{}) *gomock.Call
- func (mr *MockTxnStoreMockRecorder) Set(key, v interface{}) *gomock.Call
- func (mr *MockTxnStoreMockRecorder) SetIfNotExists(key, v interface{}) *gomock.Call
- func (mr *MockTxnStoreMockRecorder) Watch(key interface{}) *gomock.Call
- type MockValue
- type MockValueMockRecorder
- type MockValueWatch
- type MockValueWatchMockRecorder
- type MockValueWatchable
- func (m *MockValueWatchable) Close()
- func (m *MockValueWatchable) EXPECT() *MockValueWatchableMockRecorder
- func (m *MockValueWatchable) Get() Value
- func (m *MockValueWatchable) IsClosed() bool
- func (m *MockValueWatchable) NumWatches() int
- func (m *MockValueWatchable) Update(arg0 Value) error
- func (m *MockValueWatchable) Watch() (Value, ValueWatch, error)
- type MockValueWatchableMockRecorder
- func (mr *MockValueWatchableMockRecorder) Close() *gomock.Call
- func (mr *MockValueWatchableMockRecorder) Get() *gomock.Call
- func (mr *MockValueWatchableMockRecorder) IsClosed() *gomock.Call
- func (mr *MockValueWatchableMockRecorder) NumWatches() *gomock.Call
- func (mr *MockValueWatchableMockRecorder) Update(arg0 interface{}) *gomock.Call
- func (mr *MockValueWatchableMockRecorder) Watch() *gomock.Call
- type Op
- type OpResponse
- type OpType
- type OverrideConfiguration
- type OverrideOptions
- type Response
- type SetOp
- type Store
- type TargetType
- type TxnStore
- type Value
- type ValueWatch
- type ValueWatchable
Constants ¶
const (
// UninitializedVersion is the version of an uninitialized kv value.
UninitializedVersion = 0
)
Variables ¶
var ( // ErrVersionMismatch is returned when attempting a CheckAndSet and the // key is not at the provided version ErrVersionMismatch = errors.New("key is not at the specified version") // ErrAlreadyExists is returned when attempting a SetIfEmpty and the key // already has a value ErrAlreadyExists = errors.New("key already has a value") // ErrNotFound is returned when attempting a Get but no value is found for // the given key ErrNotFound = errors.New("key not found") // ErrUnknownTargetType is returned when an unknown TargetType is requested ErrUnknownTargetType = errors.New("unknown target type") // ErrUnknownCompareType is returned when an unknown CompareType is requested ErrUnknownCompareType = errors.New("unknown compare type") // ErrUnknownOpType is returned when an unknown OpType is requested ErrUnknownOpType = errors.New("unknown op type") // ErrConditionCheckFailed is returned when condition check failed ErrConditionCheckFailed = errors.New("condition check failed") )
Functions ¶
This section is empty.
Types ¶
type CompareType ¶
type CompareType string
CompareType is the type of the comparison in the condition
const (
CompareEqual CompareType = "="
)
list of supported CompareType
func (CompareType) String ¶
func (t CompareType) String() string
type Condition ¶
type Condition interface { // TargetType returns the type of the TargetType TargetType() TargetType // SetTargetType sets the type of the TargetType SetTargetType(t TargetType) Condition // CompareType returns the type of the CompareType CompareType() CompareType // SetCompareType sets the type of the CompareType SetCompareType(t CompareType) Condition // Key returns the key in the condition Key() string // SetKey sets the key in the condition SetKey(key string) Condition // Value returns the value for comparison Value() interface{} // SetValue sets the value for comparison SetValue(value interface{}) Condition }
Condition defines the prerequisite for a transaction
type MockCondition ¶
type MockCondition struct {
// contains filtered or unexported fields
}
MockCondition is a mock of Condition interface
func NewMockCondition ¶
func NewMockCondition(ctrl *gomock.Controller) *MockCondition
NewMockCondition creates a new mock instance
func (*MockCondition) CompareType ¶
func (m *MockCondition) CompareType() CompareType
CompareType mocks base method
func (*MockCondition) EXPECT ¶
func (m *MockCondition) EXPECT() *MockConditionMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockCondition) SetCompareType ¶
func (m *MockCondition) SetCompareType(t CompareType) Condition
SetCompareType mocks base method
func (*MockCondition) SetKey ¶
func (m *MockCondition) SetKey(key string) Condition
SetKey mocks base method
func (*MockCondition) SetTargetType ¶
func (m *MockCondition) SetTargetType(t TargetType) Condition
SetTargetType mocks base method
func (*MockCondition) SetValue ¶
func (m *MockCondition) SetValue(value interface{}) Condition
SetValue mocks base method
func (*MockCondition) TargetType ¶
func (m *MockCondition) TargetType() TargetType
TargetType mocks base method
type MockConditionMockRecorder ¶
type MockConditionMockRecorder struct {
// contains filtered or unexported fields
}
MockConditionMockRecorder is the mock recorder for MockCondition
func (*MockConditionMockRecorder) CompareType ¶
func (mr *MockConditionMockRecorder) CompareType() *gomock.Call
CompareType indicates an expected call of CompareType
func (*MockConditionMockRecorder) Key ¶
func (mr *MockConditionMockRecorder) Key() *gomock.Call
Key indicates an expected call of Key
func (*MockConditionMockRecorder) SetCompareType ¶
func (mr *MockConditionMockRecorder) SetCompareType(t interface{}) *gomock.Call
SetCompareType indicates an expected call of SetCompareType
func (*MockConditionMockRecorder) SetKey ¶
func (mr *MockConditionMockRecorder) SetKey(key interface{}) *gomock.Call
SetKey indicates an expected call of SetKey
func (*MockConditionMockRecorder) SetTargetType ¶
func (mr *MockConditionMockRecorder) SetTargetType(t interface{}) *gomock.Call
SetTargetType indicates an expected call of SetTargetType
func (*MockConditionMockRecorder) SetValue ¶
func (mr *MockConditionMockRecorder) SetValue(value interface{}) *gomock.Call
SetValue indicates an expected call of SetValue
func (*MockConditionMockRecorder) TargetType ¶
func (mr *MockConditionMockRecorder) TargetType() *gomock.Call
TargetType indicates an expected call of TargetType
func (*MockConditionMockRecorder) Value ¶
func (mr *MockConditionMockRecorder) Value() *gomock.Call
Value indicates an expected call of Value
type MockOp ¶
type MockOp struct {
// contains filtered or unexported fields
}
MockOp is a mock of Op interface
func NewMockOp ¶
func NewMockOp(ctrl *gomock.Controller) *MockOp
NewMockOp creates a new mock instance
func (*MockOp) EXPECT ¶
func (m *MockOp) EXPECT() *MockOpMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockOpMockRecorder ¶
type MockOpMockRecorder struct {
// contains filtered or unexported fields
}
MockOpMockRecorder is the mock recorder for MockOp
func (*MockOpMockRecorder) Key ¶
func (mr *MockOpMockRecorder) Key() *gomock.Call
Key indicates an expected call of Key
func (*MockOpMockRecorder) SetKey ¶
func (mr *MockOpMockRecorder) SetKey(key interface{}) *gomock.Call
SetKey indicates an expected call of SetKey
func (*MockOpMockRecorder) SetType ¶
func (mr *MockOpMockRecorder) SetType(ot interface{}) *gomock.Call
SetType indicates an expected call of SetType
func (*MockOpMockRecorder) Type ¶
func (mr *MockOpMockRecorder) Type() *gomock.Call
Type indicates an expected call of Type
type MockOpResponse ¶
type MockOpResponse struct {
// contains filtered or unexported fields
}
MockOpResponse is a mock of OpResponse interface
func NewMockOpResponse ¶
func NewMockOpResponse(ctrl *gomock.Controller) *MockOpResponse
NewMockOpResponse creates a new mock instance
func (*MockOpResponse) EXPECT ¶
func (m *MockOpResponse) EXPECT() *MockOpResponseMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockOpResponse) SetKey ¶
func (m *MockOpResponse) SetKey(key string) Op
SetKey mocks base method
func (*MockOpResponse) SetType ¶
func (m *MockOpResponse) SetType(ot OpType) Op
SetType mocks base method
func (*MockOpResponse) SetValue ¶
func (m *MockOpResponse) SetValue(v interface{}) OpResponse
SetValue mocks base method
type MockOpResponseMockRecorder ¶
type MockOpResponseMockRecorder struct {
// contains filtered or unexported fields
}
MockOpResponseMockRecorder is the mock recorder for MockOpResponse
func (*MockOpResponseMockRecorder) Key ¶
func (mr *MockOpResponseMockRecorder) Key() *gomock.Call
Key indicates an expected call of Key
func (*MockOpResponseMockRecorder) SetKey ¶
func (mr *MockOpResponseMockRecorder) SetKey(key interface{}) *gomock.Call
SetKey indicates an expected call of SetKey
func (*MockOpResponseMockRecorder) SetType ¶
func (mr *MockOpResponseMockRecorder) SetType(ot interface{}) *gomock.Call
SetType indicates an expected call of SetType
func (*MockOpResponseMockRecorder) SetValue ¶
func (mr *MockOpResponseMockRecorder) SetValue(v interface{}) *gomock.Call
SetValue indicates an expected call of SetValue
func (*MockOpResponseMockRecorder) Type ¶
func (mr *MockOpResponseMockRecorder) Type() *gomock.Call
Type indicates an expected call of Type
func (*MockOpResponseMockRecorder) Value ¶
func (mr *MockOpResponseMockRecorder) Value() *gomock.Call
Value indicates an expected call of Value
type MockOverrideOptions ¶
type MockOverrideOptions struct {
// contains filtered or unexported fields
}
MockOverrideOptions is a mock of OverrideOptions interface
func NewMockOverrideOptions ¶
func NewMockOverrideOptions(ctrl *gomock.Controller) *MockOverrideOptions
NewMockOverrideOptions creates a new mock instance
func (*MockOverrideOptions) EXPECT ¶
func (m *MockOverrideOptions) EXPECT() *MockOverrideOptionsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockOverrideOptions) Environment ¶
func (m *MockOverrideOptions) Environment() string
Environment mocks base method
func (*MockOverrideOptions) Namespace ¶
func (m *MockOverrideOptions) Namespace() string
Namespace mocks base method
func (*MockOverrideOptions) SetEnvironment ¶
func (m *MockOverrideOptions) SetEnvironment(env string) OverrideOptions
SetEnvironment mocks base method
func (*MockOverrideOptions) SetNamespace ¶
func (m *MockOverrideOptions) SetNamespace(namespace string) OverrideOptions
SetNamespace mocks base method
func (*MockOverrideOptions) SetZone ¶
func (m *MockOverrideOptions) SetZone(value string) OverrideOptions
SetZone mocks base method
func (*MockOverrideOptions) Validate ¶
func (m *MockOverrideOptions) Validate() error
Validate mocks base method
func (*MockOverrideOptions) Zone ¶
func (m *MockOverrideOptions) Zone() string
Zone mocks base method
type MockOverrideOptionsMockRecorder ¶
type MockOverrideOptionsMockRecorder struct {
// contains filtered or unexported fields
}
MockOverrideOptionsMockRecorder is the mock recorder for MockOverrideOptions
func (*MockOverrideOptionsMockRecorder) Environment ¶
func (mr *MockOverrideOptionsMockRecorder) Environment() *gomock.Call
Environment indicates an expected call of Environment
func (*MockOverrideOptionsMockRecorder) Namespace ¶
func (mr *MockOverrideOptionsMockRecorder) Namespace() *gomock.Call
Namespace indicates an expected call of Namespace
func (*MockOverrideOptionsMockRecorder) SetEnvironment ¶
func (mr *MockOverrideOptionsMockRecorder) SetEnvironment(env interface{}) *gomock.Call
SetEnvironment indicates an expected call of SetEnvironment
func (*MockOverrideOptionsMockRecorder) SetNamespace ¶
func (mr *MockOverrideOptionsMockRecorder) SetNamespace(namespace interface{}) *gomock.Call
SetNamespace indicates an expected call of SetNamespace
func (*MockOverrideOptionsMockRecorder) SetZone ¶
func (mr *MockOverrideOptionsMockRecorder) SetZone(value interface{}) *gomock.Call
SetZone indicates an expected call of SetZone
func (*MockOverrideOptionsMockRecorder) Validate ¶
func (mr *MockOverrideOptionsMockRecorder) Validate() *gomock.Call
Validate indicates an expected call of Validate
func (*MockOverrideOptionsMockRecorder) Zone ¶
func (mr *MockOverrideOptionsMockRecorder) Zone() *gomock.Call
Zone indicates an expected call of Zone
type MockResponse ¶
type MockResponse struct {
// contains filtered or unexported fields
}
MockResponse is a mock of Response interface
func NewMockResponse ¶
func NewMockResponse(ctrl *gomock.Controller) *MockResponse
NewMockResponse creates a new mock instance
func (*MockResponse) EXPECT ¶
func (m *MockResponse) EXPECT() *MockResponseMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockResponse) Responses ¶
func (m *MockResponse) Responses() []OpResponse
Responses mocks base method
func (*MockResponse) SetResponses ¶
func (m *MockResponse) SetResponses(oprs []OpResponse) Response
SetResponses mocks base method
type MockResponseMockRecorder ¶
type MockResponseMockRecorder struct {
// contains filtered or unexported fields
}
MockResponseMockRecorder is the mock recorder for MockResponse
func (*MockResponseMockRecorder) Responses ¶
func (mr *MockResponseMockRecorder) Responses() *gomock.Call
Responses indicates an expected call of Responses
func (*MockResponseMockRecorder) SetResponses ¶
func (mr *MockResponseMockRecorder) SetResponses(oprs interface{}) *gomock.Call
SetResponses indicates an expected call of SetResponses
type MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
MockStore is a mock of Store interface
func NewMockStore ¶
func NewMockStore(ctrl *gomock.Controller) *MockStore
NewMockStore creates a new mock instance
func (*MockStore) CheckAndSet ¶
CheckAndSet mocks base method
func (*MockStore) EXPECT ¶
func (m *MockStore) EXPECT() *MockStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockStore) SetIfNotExists ¶
SetIfNotExists mocks base method
type MockStoreMockRecorder ¶
type MockStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreMockRecorder is the mock recorder for MockStore
func (*MockStoreMockRecorder) CheckAndSet ¶
func (mr *MockStoreMockRecorder) CheckAndSet(key, version, v interface{}) *gomock.Call
CheckAndSet indicates an expected call of CheckAndSet
func (*MockStoreMockRecorder) Delete ¶
func (mr *MockStoreMockRecorder) Delete(key interface{}) *gomock.Call
Delete indicates an expected call of Delete
func (*MockStoreMockRecorder) Get ¶
func (mr *MockStoreMockRecorder) Get(key interface{}) *gomock.Call
Get indicates an expected call of Get
func (*MockStoreMockRecorder) History ¶
func (mr *MockStoreMockRecorder) History(key, from, to interface{}) *gomock.Call
History indicates an expected call of History
func (*MockStoreMockRecorder) Set ¶
func (mr *MockStoreMockRecorder) Set(key, v interface{}) *gomock.Call
Set indicates an expected call of Set
func (*MockStoreMockRecorder) SetIfNotExists ¶
func (mr *MockStoreMockRecorder) SetIfNotExists(key, v interface{}) *gomock.Call
SetIfNotExists indicates an expected call of SetIfNotExists
func (*MockStoreMockRecorder) Watch ¶
func (mr *MockStoreMockRecorder) Watch(key interface{}) *gomock.Call
Watch indicates an expected call of Watch
type MockTxnStore ¶
type MockTxnStore struct {
// contains filtered or unexported fields
}
MockTxnStore is a mock of TxnStore interface
func NewMockTxnStore ¶
func NewMockTxnStore(ctrl *gomock.Controller) *MockTxnStore
NewMockTxnStore creates a new mock instance
func (*MockTxnStore) CheckAndSet ¶
CheckAndSet mocks base method
func (*MockTxnStore) Commit ¶
func (m *MockTxnStore) Commit(arg0 []Condition, arg1 []Op) (Response, error)
Commit mocks base method
func (*MockTxnStore) Delete ¶
func (m *MockTxnStore) Delete(key string) (Value, error)
Delete mocks base method
func (*MockTxnStore) EXPECT ¶
func (m *MockTxnStore) EXPECT() *MockTxnStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockTxnStore) Get ¶
func (m *MockTxnStore) Get(key string) (Value, error)
Get mocks base method
func (*MockTxnStore) History ¶
func (m *MockTxnStore) History(key string, from, to int) ([]Value, error)
History mocks base method
func (*MockTxnStore) SetIfNotExists ¶
SetIfNotExists mocks base method
func (*MockTxnStore) Watch ¶
func (m *MockTxnStore) Watch(key string) (ValueWatch, error)
Watch mocks base method
type MockTxnStoreMockRecorder ¶
type MockTxnStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockTxnStoreMockRecorder is the mock recorder for MockTxnStore
func (*MockTxnStoreMockRecorder) CheckAndSet ¶
func (mr *MockTxnStoreMockRecorder) CheckAndSet(key, version, v interface{}) *gomock.Call
CheckAndSet indicates an expected call of CheckAndSet
func (*MockTxnStoreMockRecorder) Commit ¶
func (mr *MockTxnStoreMockRecorder) Commit(arg0, arg1 interface{}) *gomock.Call
Commit indicates an expected call of Commit
func (*MockTxnStoreMockRecorder) Delete ¶
func (mr *MockTxnStoreMockRecorder) Delete(key interface{}) *gomock.Call
Delete indicates an expected call of Delete
func (*MockTxnStoreMockRecorder) Get ¶
func (mr *MockTxnStoreMockRecorder) Get(key interface{}) *gomock.Call
Get indicates an expected call of Get
func (*MockTxnStoreMockRecorder) History ¶
func (mr *MockTxnStoreMockRecorder) History(key, from, to interface{}) *gomock.Call
History indicates an expected call of History
func (*MockTxnStoreMockRecorder) Set ¶
func (mr *MockTxnStoreMockRecorder) Set(key, v interface{}) *gomock.Call
Set indicates an expected call of Set
func (*MockTxnStoreMockRecorder) SetIfNotExists ¶
func (mr *MockTxnStoreMockRecorder) SetIfNotExists(key, v interface{}) *gomock.Call
SetIfNotExists indicates an expected call of SetIfNotExists
func (*MockTxnStoreMockRecorder) Watch ¶
func (mr *MockTxnStoreMockRecorder) Watch(key interface{}) *gomock.Call
Watch indicates an expected call of Watch
type MockValue ¶
type MockValue struct {
// contains filtered or unexported fields
}
MockValue is a mock of Value interface
func NewMockValue ¶
func NewMockValue(ctrl *gomock.Controller) *MockValue
NewMockValue creates a new mock instance
func (*MockValue) EXPECT ¶
func (m *MockValue) EXPECT() *MockValueMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockValueMockRecorder ¶
type MockValueMockRecorder struct {
// contains filtered or unexported fields
}
MockValueMockRecorder is the mock recorder for MockValue
func (*MockValueMockRecorder) IsNewer ¶
func (mr *MockValueMockRecorder) IsNewer(other interface{}) *gomock.Call
IsNewer indicates an expected call of IsNewer
func (*MockValueMockRecorder) Unmarshal ¶
func (mr *MockValueMockRecorder) Unmarshal(v interface{}) *gomock.Call
Unmarshal indicates an expected call of Unmarshal
func (*MockValueMockRecorder) Version ¶
func (mr *MockValueMockRecorder) Version() *gomock.Call
Version indicates an expected call of Version
type MockValueWatch ¶
type MockValueWatch struct {
// contains filtered or unexported fields
}
MockValueWatch is a mock of ValueWatch interface
func NewMockValueWatch ¶
func NewMockValueWatch(ctrl *gomock.Controller) *MockValueWatch
NewMockValueWatch creates a new mock instance
func (*MockValueWatch) EXPECT ¶
func (m *MockValueWatch) EXPECT() *MockValueWatchMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockValueWatchMockRecorder ¶
type MockValueWatchMockRecorder struct {
// contains filtered or unexported fields
}
MockValueWatchMockRecorder is the mock recorder for MockValueWatch
func (*MockValueWatchMockRecorder) C ¶
func (mr *MockValueWatchMockRecorder) C() *gomock.Call
C indicates an expected call of C
func (*MockValueWatchMockRecorder) Close ¶
func (mr *MockValueWatchMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockValueWatchMockRecorder) Get ¶
func (mr *MockValueWatchMockRecorder) Get() *gomock.Call
Get indicates an expected call of Get
type MockValueWatchable ¶
type MockValueWatchable struct {
// contains filtered or unexported fields
}
MockValueWatchable is a mock of ValueWatchable interface
func NewMockValueWatchable ¶
func NewMockValueWatchable(ctrl *gomock.Controller) *MockValueWatchable
NewMockValueWatchable creates a new mock instance
func (*MockValueWatchable) EXPECT ¶
func (m *MockValueWatchable) EXPECT() *MockValueWatchableMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockValueWatchable) IsClosed ¶
func (m *MockValueWatchable) IsClosed() bool
IsClosed mocks base method
func (*MockValueWatchable) NumWatches ¶
func (m *MockValueWatchable) NumWatches() int
NumWatches mocks base method
func (*MockValueWatchable) Update ¶
func (m *MockValueWatchable) Update(arg0 Value) error
Update mocks base method
func (*MockValueWatchable) Watch ¶
func (m *MockValueWatchable) Watch() (Value, ValueWatch, error)
Watch mocks base method
type MockValueWatchableMockRecorder ¶
type MockValueWatchableMockRecorder struct {
// contains filtered or unexported fields
}
MockValueWatchableMockRecorder is the mock recorder for MockValueWatchable
func (*MockValueWatchableMockRecorder) Close ¶
func (mr *MockValueWatchableMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockValueWatchableMockRecorder) Get ¶
func (mr *MockValueWatchableMockRecorder) Get() *gomock.Call
Get indicates an expected call of Get
func (*MockValueWatchableMockRecorder) IsClosed ¶
func (mr *MockValueWatchableMockRecorder) IsClosed() *gomock.Call
IsClosed indicates an expected call of IsClosed
func (*MockValueWatchableMockRecorder) NumWatches ¶
func (mr *MockValueWatchableMockRecorder) NumWatches() *gomock.Call
NumWatches indicates an expected call of NumWatches
func (*MockValueWatchableMockRecorder) Update ¶
func (mr *MockValueWatchableMockRecorder) Update(arg0 interface{}) *gomock.Call
Update indicates an expected call of Update
func (*MockValueWatchableMockRecorder) Watch ¶
func (mr *MockValueWatchableMockRecorder) Watch() *gomock.Call
Watch indicates an expected call of Watch
type Op ¶
type Op interface { // Type returns the type of the operation Type() OpType // SetType sets the type of the operation SetType(ot OpType) Op // Key returns the key used in the operation Key() string // SetKey sets the key in the operation SetKey(key string) Op }
Op is the operation to be performed in a transaction
type OpResponse ¶
type OpResponse interface { Op Value() interface{} SetValue(v interface{}) OpResponse }
OpResponse is the response of a transaction operation
type OverrideConfiguration ¶
type OverrideConfiguration struct { Zone string `yaml:"zone"` Environment string `yaml:"environment"` Namespace string `yaml:"namespace"` }
OverrideConfiguration is the config for OverrideOptions.
func (OverrideConfiguration) NewOverrideOptions ¶
func (cfg OverrideConfiguration) NewOverrideOptions() (OverrideOptions, error)
NewOverrideOptions creates a OverrideOptions.
type OverrideOptions ¶
type OverrideOptions interface { // Zone returns the zone of the KV store. Zone() string // SetZone sets the zone of the KV store. SetZone(value string) OverrideOptions // Namespace returns the namespace of the KV store. Namespace() string // SetNamespace sets the namespace of the KV store. SetNamespace(namespace string) OverrideOptions // Environment returns the environment of the KV store. Environment() string // SetEnvironment sets the environment of the KV store. SetEnvironment(env string) OverrideOptions // Validate validates the Options. Validate() error }
OverrideOptions provides a set of options to override the default configurations of a KV store.
func NewOverrideOptions ¶
func NewOverrideOptions() OverrideOptions
NewOverrideOptions creates a new kv Options.
type Response ¶
type Response interface { Responses() []OpResponse SetResponses(oprs []OpResponse) Response }
Response captures the response of the transaction
type Store ¶
type Store interface { // Get retrieves the value for the given key Get(key string) (Value, error) // Watch adds a watch for value updates for given key. This is a non-blocking // call - a notification will be sent to ValueWatch.C() once a value is // available Watch(key string) (ValueWatch, error) // Set stores the value for the given key Set(key string, v proto.Message) (int, error) // SetIfNotExists sets the value for the given key only if no value already // exists SetIfNotExists(key string, v proto.Message) (int, error) // CheckAndSet stores the value for the given key if the current version // matches the provided version CheckAndSet(key string, version int, v proto.Message) (int, error) // Delete deletes a key in the store and returns the last value before deletion Delete(key string) (Value, error) // History returns the value for a key in version range [from, to) History(key string, from, to int) ([]Value, error) }
Store provides access to the configuration store
type TargetType ¶
type TargetType int
TargetType is the type of the comparison target in the condition
const (
TargetVersion TargetType = iota
)
list of supported TargetTypes
type Value ¶
type Value interface { // Unmarshal retrieves the stored value Unmarshal(v proto.Message) error // Version returns the current version of the value Version() int // IsNewer returns if this Value is newer than the other Value IsNewer(other Value) bool }
A Value provides access to a versioned value in the configuration store
type ValueWatch ¶
type ValueWatch interface { // C returns the notification channel C() <-chan struct{} // Get returns the latest version of the value Get() Value // Close stops watching for value updates Close() }
ValueWatch provides updates to a Value
type ValueWatchable ¶
type ValueWatchable interface { // Get returns the latest Value Get() Value // Watch returns the Value and a ValueWatch that will be notified on updates Watch() (Value, ValueWatch, error) // NumWatches returns the number of watches on the Watchable NumWatches() int // Update sets the Value and notify Watches Update(Value) error // IsClosed returns true if the Watchable is closed IsClosed() bool // Close stops watching for value updates Close() }
ValueWatchable can be watched for Value changes
func NewValueWatchable ¶
func NewValueWatchable() ValueWatchable
NewValueWatchable creates a new ValueWatchable