arbiter

package
v0.1.726 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	contract.ArbiterOperator
}

func NewClient

func NewClient(d Dependencies, opts ClientOptions) (Client, error)

type ClientOption

type ClientOption func(*ClientOptions)

func WithTimeout

func WithTimeout(x time.Duration) ClientOption

type ClientOptions

type ClientOptions struct {
	Timeout time.Duration
}

func ApplyClientOptions

func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions

type DefaultTool

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool

func (*DefaultTool) Claim

func (d *DefaultTool) Claim(ctx context.Context, key fmt.Stringer, owner string) (bool, error)

Claim attempts to acquire ownership of a key with a TTL.

func (*DefaultTool) ClaimRun

func (d *DefaultTool) ClaimRun(ctx context.Context, opts contract.ClaimRunOptions) (bool, error)

ClaimRun attempts to claim a generic run.

func (*DefaultTool) ClaimRunReembed

func (d *DefaultTool) ClaimRunReembed(ctx context.Context, opts contract.ClaimRunReembedOptions) (bool, error)

ClaimRunReembed attempts to claim a reembedding run.

func (*DefaultTool) Close

func (d *DefaultTool) Close(ctx context.Context) error

Close closes the underlying client.

func (*DefaultTool) Extend

func (d *DefaultTool) Extend(ctx context.Context, key fmt.Stringer, owner string) (bool, error)

Extend refreshes the TTL of an owned key.

func (*DefaultTool) Release

func (d *DefaultTool) Release(ctx context.Context, key fmt.Stringer, owner string) error

Release relinquishes ownership of a key.

type Dependencies

type Dependencies struct {
	C contract.ArbiterOperator
}

type Tool

type Tool interface {
	Client
}

Jump to

Keyboard shortcuts

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