servers

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockOpts

type LockOpts struct {
	LeaseDuration time.Duration
	RetryBackoff  time.Duration
	MaxAttempts   int
}

type Repository

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

func New

func New(client *redis.Client, locker *redislock.Manager, c clockwork.Clock) *Repository

func (*Repository) Add

func (r *Repository) Add(
	ctx context.Context,
	svr server.Server,
	onConflict func(*server.Server) bool,
) (server.Server, error)

func (*Repository) Count

func (r *Repository) Count(ctx context.Context) (int, error)

func (*Repository) CountByStatus

func (r *Repository) CountByStatus(ctx context.Context) (map[ds.DiscoveryStatus]int, error)

func (*Repository) Filter

func (*Repository) Get

func (r *Repository) Get(ctx context.Context, addr addr.Addr) (server.Server, error)

func (*Repository) Remove

func (r *Repository) Remove(
	ctx context.Context,
	svr server.Server,
	onConflict func(*server.Server) bool,
) error

func (*Repository) Update

func (r *Repository) Update(
	ctx context.Context,
	svr server.Server,
	onConflict func(*server.Server) bool,
) (server.Server, error)

Jump to

Keyboard shortcuts

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