arbiter

package
v0.1.984 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 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 = contract.Opt[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) AbsorbLoad added in v0.1.773

func (d *DefaultTool) AbsorbLoad(ctx context.Context, c fmt.Stringer, ttl time.Duration) (bool, error)

AbsorbLoad sets a unique key with the given TTL, returns true if load is absorbed (key already present), or false if key was just created.

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) ClaimRunPSPWebhookSync added in v0.1.922

func (d *DefaultTool) ClaimRunPSPWebhookSync(ctx context.Context, opts contract.ClaimRunPSPWebhookSyncOptions) (bool, error)

ClaimRunPSPWebhookSync attempts to claim a PSP webhook sync run.

func (*DefaultTool) ClaimRunReact added in v0.1.945

func (d *DefaultTool) ClaimRunReact(ctx context.Context, opts contract.ClaimRunReactOptions) (bool, error)

ClaimRunReact attempts to claim a chat reaction sync 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) ClaimRunStatsPop added in v0.1.773

func (d *DefaultTool) ClaimRunStatsPop(ctx context.Context, opts contract.ClaimRunStatsPopOptions) (bool, error)

ClaimRunStatsPop attempts to claim a feed statistics population run.

func (*DefaultTool) ClaimRunSyncChatRoom added in v0.1.947

func (d *DefaultTool) ClaimRunSyncChatRoom(ctx context.Context, opts contract.ClaimRunSyncChatRoomOptions) (bool, error)

ClaimRunSyncChatRoom attempts to claim a chat room sync run.

func (*DefaultTool) ClaimRunUpdateItemQuantity added in v0.1.823

func (d *DefaultTool) ClaimRunUpdateItemQuantity(ctx context.Context, opts contract.ClaimRunUpdateItemQuantityOptions) (bool, error)

ClaimRunUpdateItemQuantity attempts to claim an item quantity update 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) NewToken added in v0.1.924

func (d *DefaultTool) NewToken(ctx context.Context) (string, error)

NewToken generates a new arbiter token.

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