Documentation ¶
Index ¶
- Variables
- type Backend
- type Cluster
- type ConsistencyLevel
- type DeleteRequest
- type Engine
- type ExistsRequest
- type ExistsResponse
- type ExpireRequest
- type ExpireResponse
- type GetRequest
- type GetResponse
- type GetTTLRequest
- type GetTTLResponse
- type LockRequest
- type Mock_Backend
- func (m *Mock_Backend) Address() string
- func (m *Mock_Backend) Close() error
- func (m *Mock_Backend) Delete(key string) error
- func (m *Mock_Backend) Exists(key string) (bool, error)
- func (m *Mock_Backend) Expire(key string, expiration time.Duration) error
- func (m *Mock_Backend) FlushDB() error
- func (m *Mock_Backend) Get(key string) ([]byte, error)
- func (m *Mock_Backend) Lock(key string, value []byte, expiration time.Duration) error
- func (m *Mock_Backend) Set(key string, value []byte, expiration time.Duration) error
- func (m *Mock_Backend) TTL(key string) (*time.Duration, error)
- func (m *Mock_Backend) Unlock(key string) error
- type Mock_Cluster
- type Mock_Engine
- type Mock_Service
- func (m *Mock_Service) Close() error
- func (m *Mock_Service) Delete(ctx context.Context, request *DeleteRequest) error
- func (m *Mock_Service) Exists(ctx context.Context, request *ExistsRequest) (*ExistsResponse, error)
- func (m *Mock_Service) Expire(ctx context.Context, request *ExpireRequest) (*ExpireResponse, error)
- func (m *Mock_Service) FlushDB(ctx context.Context) error
- func (m *Mock_Service) Get(ctx context.Context, request *GetRequest) (*GetResponse, error)
- func (m *Mock_Service) GetTTL(ctx context.Context, request *GetTTLRequest) (*GetTTLResponse, error)
- func (m *Mock_Service) Lock(ctx context.Context, request *LockRequest) error
- func (m *Mock_Service) Set(ctx context.Context, request *SetRequest) error
- func (m *Mock_Service) Unlock(ctx context.Context, request *UnlockRequest) error
- type OperationMode
- type Policy
- type ReadClusterView
- type ReadOperator
- type ReadOptions
- type RepairArgs
- type RepairOperator
- type RollbackArgs
- type RollbackOperator
- type Server
- type Service
- type SetRequest
- type UnlockRequest
- type ValueComparer
- type Voting
- type VotingFactory
- type VotingMode
- type WriteClusterView
- type WriteOperator
- type WriteOptions
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { io.Closer Set(key string, value []byte, expiration time.Duration) error Expire(key string, expiration time.Duration) error Lock(key string, value []byte, expiration time.Duration) error Unlock(key string) error TTL(key string) (*time.Duration, error) Get(key string) ([]byte, error) Delete(key string) error FlushDB() error Exists(key string) (bool, error) Address() string }
type Cluster ¶
type Cluster interface { io.Closer Read(key string, consistency ConsistencyLevel) (ReadClusterView, error) Write(key string, consistency ConsistencyLevel) (WriteClusterView, error) FlushDB() (WriteClusterView, error) }
type ConsistencyLevel ¶
type ConsistencyLevel int
const ( ConsistencyLevel_DEFAULT ConsistencyLevel = 0 ConsistencyLevel_ONE ConsistencyLevel = 1 ConsistencyLevel_MAJORITY ConsistencyLevel = 2 ConsistencyLevel_ALL ConsistencyLevel = 3 )
type DeleteRequest ¶
type DeleteRequest struct { Key string Options WriteOptions }
type Engine ¶
type Engine interface { io.Closer Read(nodes []Backend, votesRequired int, operator ReadOperator, repair RepairOperator, cmp ValueComparer, mode VotingMode) (interface{}, error) Write(nodes []Backend, acknowledgeRequired int, operator WriteOperator, rollback RollbackOperator, mode OperationMode) error }
type ExistsRequest ¶
type ExistsRequest struct { Key string Options ReadOptions }
type ExistsResponse ¶
type ExistsResponse struct {
Exists bool
}
type ExpireRequest ¶
type ExpireRequest struct { Key string Expiration time.Duration Options WriteOptions }
type ExpireResponse ¶
type ExpireResponse struct {
Exists bool
}
type GetRequest ¶
type GetRequest struct { Key string Options ReadOptions }
type GetResponse ¶
type GetResponse struct {
Data []byte
}
type GetTTLRequest ¶
type GetTTLRequest struct { Key string Options ReadOptions }
type GetTTLResponse ¶
type LockRequest ¶
type LockRequest struct { Key string Data []byte Expiration time.Duration Options WriteOptions }
type Mock_Backend ¶
func (*Mock_Backend) Address ¶
func (m *Mock_Backend) Address() string
func (*Mock_Backend) Close ¶
func (m *Mock_Backend) Close() error
func (*Mock_Backend) Delete ¶
func (m *Mock_Backend) Delete(key string) error
func (*Mock_Backend) Expire ¶
func (m *Mock_Backend) Expire(key string, expiration time.Duration) error
func (*Mock_Backend) FlushDB ¶
func (m *Mock_Backend) FlushDB() error
func (*Mock_Backend) Unlock ¶
func (m *Mock_Backend) Unlock(key string) error
type Mock_Cluster ¶
func (*Mock_Cluster) Close ¶
func (m *Mock_Cluster) Close() error
func (*Mock_Cluster) FlushDB ¶
func (m *Mock_Cluster) FlushDB() (WriteClusterView, error)
func (*Mock_Cluster) Read ¶
func (m *Mock_Cluster) Read(key string, consistency ConsistencyLevel) (ReadClusterView, error)
func (*Mock_Cluster) Write ¶
func (m *Mock_Cluster) Write(key string, consistency ConsistencyLevel) (WriteClusterView, error)
type Mock_Engine ¶
func (*Mock_Engine) Close ¶
func (m *Mock_Engine) Close() error
func (*Mock_Engine) Read ¶
func (m *Mock_Engine) Read(nodes []Backend, votesRequired int, operator ReadOperator, repair RepairOperator, cmp ValueComparer, mode VotingMode) (interface{}, error)
func (*Mock_Engine) Write ¶
func (m *Mock_Engine) Write(nodes []Backend, acknowledgeRequired int, operator WriteOperator, rollback RollbackOperator, mode OperationMode) error
type Mock_Service ¶
func (*Mock_Service) Close ¶
func (m *Mock_Service) Close() error
func (*Mock_Service) Delete ¶
func (m *Mock_Service) Delete(ctx context.Context, request *DeleteRequest) error
func (*Mock_Service) Exists ¶
func (m *Mock_Service) Exists(ctx context.Context, request *ExistsRequest) (*ExistsResponse, error)
func (*Mock_Service) Expire ¶
func (m *Mock_Service) Expire(ctx context.Context, request *ExpireRequest) (*ExpireResponse, error)
func (*Mock_Service) Get ¶
func (m *Mock_Service) Get(ctx context.Context, request *GetRequest) (*GetResponse, error)
func (*Mock_Service) GetTTL ¶
func (m *Mock_Service) GetTTL(ctx context.Context, request *GetTTLRequest) (*GetTTLResponse, error)
func (*Mock_Service) Lock ¶
func (m *Mock_Service) Lock(ctx context.Context, request *LockRequest) error
func (*Mock_Service) Set ¶
func (m *Mock_Service) Set(ctx context.Context, request *SetRequest) error
func (*Mock_Service) Unlock ¶
func (m *Mock_Service) Unlock(ctx context.Context, request *UnlockRequest) error
type OperationMode ¶
type OperationMode int
var ( OperationModeConcurrent OperationMode OperationModeSequential OperationMode = 1 )
type ReadClusterView ¶
type ReadClusterView struct { Backends []Backend VoteRequired int VotingMode VotingMode }
type ReadOperator ¶
type ReadOptions ¶
type ReadOptions struct {
Consistency ConsistencyLevel
}
type RepairArgs ¶
type RepairOperator ¶
type RepairOperator func(args RepairArgs)
type RollbackArgs ¶
type RollbackArgs struct {
Nodes []Backend
}
type RollbackOperator ¶
type RollbackOperator func(args RollbackArgs)
type Service ¶
type Service interface { io.Closer Set(ctx context.Context, request *SetRequest) error Get(ctx context.Context, request *GetRequest) (*GetResponse, error) Delete(ctx context.Context, request *DeleteRequest) error Lock(ctx context.Context, request *LockRequest) error Unlock(ctx context.Context, request *UnlockRequest) error Exists(ctx context.Context, request *ExistsRequest) (*ExistsResponse, error) GetTTL(ctx context.Context, request *GetTTLRequest) (*GetTTLResponse, error) Expire(ctx context.Context, request *ExpireRequest) (*ExpireResponse, error) FlushDB(ctx context.Context) error }
type SetRequest ¶
type SetRequest struct { Key string Data []byte Expiration time.Duration Options WriteOptions }
type UnlockRequest ¶
type UnlockRequest struct { Key string Options WriteOptions }
type ValueComparer ¶
type ValueComparer func(x, y interface{}) bool
type VotingFactory ¶
type VotingFactory func(cmp ValueComparer) Voting
type VotingMode ¶
type VotingMode int
var ( VotingModeVoteOnNotFound VotingMode VotingModeSkipVoteOnNotFound VotingMode = 1 )
type WriteClusterView ¶
type WriteOperator ¶
type WriteOptions ¶
type WriteOptions struct {
Consistency ConsistencyLevel
}
Click to show internal directories.
Click to hide internal directories.