userapi

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockData

type LockData struct {
	AgentID   string `json:"agent_id"`
	ExpiresAt int64  `json:"expires_at"` // Unix timestamp in nanoseconds
}

LockData represents the contents of a _lock file.

type UserAPI

type UserAPI struct {
	// contains filtered or unexported fields
}

UserAPI provides client-facing operations for interacting with the Key-Value store.

func New

func New(cell *paxos.Cell) *UserAPI

New creates a new UserAPI instance backed by the given Paxos cell.

func (*UserAPI) AcquireLock

AcquireLock attempts to acquire locks for all lockable segments in a key path.

func (*UserAPI) CheckLocks

func (a *UserAPI) CheckLocks(ctx context.Context, keyPath string) error

CheckLocks verifies that all locks for a path are held by this agent.

func (*UserAPI) CompareAndWrite

func (a *UserAPI) CompareAndWrite(ctx context.Context, key string, oldValue, newValue []byte, qt paxos.QuorumType) (*paxosv1.CompareAndWriteResponse, error)

CompareAndWrite implements CAS using paxos proposal and backoff.

func (*UserAPI) Read

func (a *UserAPI) Read(ctx context.Context, key string, quorum paxosv1.ReadQuorum) (*paxosv1.ReadResponse, error)

Read implements the quorum read logic.

func (*UserAPI) ReadPrefix

func (a *UserAPI) ReadPrefix(ctx context.Context, prefix string) (*paxosv1.ReadPrefixResponse, error)

ReadPrefix returns all non-deleted Key-Value entries matching the specified prefix.

func (*UserAPI) ReleaseLock

ReleaseLock releases locks for all lockable segments in a key path that are held by this agent.

func (*UserAPI) RenewLock

RenewLock attempts to renew the lease duration for all lockable segments in a key path.

func (*UserAPI) Shutdown

Shutdown initiates a graceful shutdown sequence. It proposes the removal of this node from the cluster and signals the main server to enter lame duck mode.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL