Documentation ¶
Index ¶
- Constants
- Variables
- type Global
- func (s Global) Delete(ctx context.Context, key string) error
- func (s Global) DeleteIf(ctx context.Context, key string, expected backend.Version) error
- func (s Global) GetMetadata(ctx context.Context, key string) (backend.Metadata, error)
- func (s Global) Read(ctx context.Context, key string) (GlobalRead, error)
- func (s Global) SetTagsIf(ctx context.Context, key string, expected backend.Version, t backend.Tags) (backend.Metadata, error)
- func (s Global) Write(ctx context.Context, key string, value []byte, t backend.Tags) (backend.Metadata, error)
- func (s Global) WriteIf(ctx context.Context, key string, value []byte, expected backend.Version, ...) (backend.Metadata, error)
- func (s Global) WriteIfNotExists(ctx context.Context, key string, value []byte, t backend.Tags) (backend.Metadata, error)
- type GlobalRead
- type Local
- func (c Local) Delete(key string)
- func (c Local) GetMeta(key string, maxStale time.Duration) (LocalMetadata, bool)
- func (c Local) MarkDeleted(key string, v Version)
- func (c Local) MarkValueOutated(key string, v Version)
- func (c Local) Read(key string, maxStale time.Duration) (LocalRead, bool)
- func (c Local) SetMeta(key string, meta backend.Metadata)
- func (c Local) Write(key string, value []byte, v Version)
- func (c Local) WriteWithMeta(key string, value []byte, meta backend.Metadata)
- type LocalMetadata
- type LocalRead
- type LockInfo
- type LockOps
- type LockRequest
- type LockType
- type LockUpdate
- type Locker
- type PathLock
- type TLogger
- func (t TLogger) CommitStatus(ctx context.Context, id data.TxID) (TxStatus, error)
- func (t TLogger) Delete(ctx context.Context, id data.TxID) error
- func (t TLogger) Get(ctx context.Context, id data.TxID) (TxLog, error)
- func (t TLogger) Set(ctx context.Context, l TxLog) (backend.Version, error)
- func (t TLogger) SetIf(ctx context.Context, l TxLog, expected backend.Version) (backend.Version, error)
- type TValue
- type TxCommitStatus
- type TxLog
- type TxPathState
- type TxStatus
- type TxWrite
- type Version
Constants ¶
View Source
const MaxStaleness = time.Duration(math.MaxInt64)
Variables ¶
View Source
var ErrKeyNotFound = errors.New("key not found in committed transaction")
Functions ¶
This section is empty.
Types ¶
type Global ¶
type Global struct {
// contains filtered or unexported fields
}
func (Global) GetMetadata ¶
type GlobalRead ¶
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
func (Local) MarkDeleted ¶
func (Local) MarkValueOutated ¶
MarkStale annotates the given key value as outdated, only if it's currently set at the given version.
type LocalMetadata ¶
type LockInfo ¶
func TagsLockInfo ¶
TagsLockInfo parses tags managing locks on an object.
type LockOps ¶
type LockOps struct { // Update is the possible next update on the lock. If nothing should be // updated, HasUpdate will be false. Update LockUpdate HasUpdate bool // WaitFor is the list of transactions that need to unlock before any // operation can be performed. WaitFor []data.TxID // What effect these operations will have. LockedFor []data.TxID UnlockedFor []data.TxID }
LockOps represents what possible next update can be done to a lock.
This includes the update, what transactions need to unlock before this can done and what effects the operation will have.
func ComputeLockUpdate ¶
func ComputeLockUpdate(curr LockInfo, req LockRequest, txs []TxPathState) (LockOps, error)
type LockRequest ¶
type LockUpdate ¶
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
func (Locker) UnlockCreateUncommitted ¶
func (Locker) UpdateLock ¶
type TLogger ¶
type TLogger struct {
// contains filtered or unexported fields
}
TLogger provides tools to deal with transaction logs.
func (TLogger) CommitStatus ¶
type TxCommitStatus ¶
type TxCommitStatus int
const ( TxCommitStatusUnknown TxCommitStatus = iota TxCommitStatusOK TxCommitStatusAborted TxCommitStatusPending )
func (TxCommitStatus) IsFinal ¶
func (s TxCommitStatus) IsFinal() bool
type TxPathState ¶
type TxPathState struct { Tx data.TxID Status TxCommitStatus Value TValue }
type TxStatus ¶
type TxStatus struct { Status TxCommitStatus LastUpdate time.Time Version backend.Version }
Click to show internal directories.
Click to hide internal directories.