Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidRequest = errors.New("invalid request")
View Source
var ErrKeyAlreadyLocked = errors.New("key already locked")
View Source
var ErrKeyNotLocked = errors.New("key not locked")
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var ErrUnknownRequestType = errors.New("unknown request type")
Functions ¶
This section is empty.
Types ¶
type Coordinate ¶
type Coordinate struct {
// contains filtered or unexported fields
}
func NewCoordinator ¶
func NewCoordinator(txm Transactional, r *raft.Raft) *Coordinate
func (*Coordinate) Dispatch ¶
func (c *Coordinate) Dispatch(reqs *OperationGroup[OP]) (*CoordinateResponse, error)
func (*Coordinate) IsLeader ¶
func (c *Coordinate) IsLeader() bool
type CoordinateResponse ¶
type CoordinateResponse struct {
CommitIndex uint64
}
type Coordinator ¶
type Coordinator interface { Dispatch(reqs *OperationGroup[OP]) (*CoordinateResponse, error) IsLeader() bool }
type OperationGroup ¶
OperationGroup is a group of operations that should be executed atomically.
type TransactionManager ¶
type TransactionManager struct {
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction(raft *raft.Raft) *TransactionManager
func (*TransactionManager) Abort ¶
func (t *TransactionManager) Abort(reqs []*pb.Request) (*TransactionResponse, error)
func (*TransactionManager) Commit ¶
func (t *TransactionManager) Commit(reqs []*pb.Request) (*TransactionResponse, error)
type TransactionResponse ¶
type TransactionResponse struct {
CommitIndex uint64
}
type Transactional ¶
type Transactional interface { Commit(reqs []*pb.Request) (*TransactionResponse, error) Abort(reqs []*pb.Request) (*TransactionResponse, error) }
Click to show internal directories.
Click to hide internal directories.