testutil

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestStore

func NewTestStore(t *testing.T) *collstore.Store

func SeedGlobalFlags

func SeedGlobalFlags(t *testing.T, st *collstore.Store)

Types

type FakeLocker

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

FakeLocker is an in-memory lockers.Locker for manager integration tests.

func NewFakeLocker

func NewFakeLocker() *FakeLocker

func (*FakeLocker) Deregister

func (f *FakeLocker) Deregister(string) error

func (*FakeLocker) GetServices

func (f *FakeLocker) GetServices(context.Context, string, []string) ([]*lockers.Service, error)

func (*FakeLocker) Init

func (f *FakeLocker) Init(context.Context, map[string]any, ...lockers.Option) error

func (*FakeLocker) IsLocked

func (f *FakeLocker) IsLocked(_ context.Context, key string) (bool, error)

func (*FakeLocker) KeepLock

func (f *FakeLocker) KeepLock(ctx context.Context, key string) (chan struct{}, chan error)

func (*FakeLocker) List

func (f *FakeLocker) List(_ context.Context, prefix string) (map[string]string, error)

func (*FakeLocker) Lock

func (f *FakeLocker) Lock(_ context.Context, key string, val []byte) (bool, error)

func (*FakeLocker) Register

func (*FakeLocker) SetLock

func (f *FakeLocker) SetLock(key, holder string)

SetLock seeds a lock as if held by holder (member id).

func (*FakeLocker) SetLogger

func (f *FakeLocker) SetLogger(l *slog.Logger)

func (*FakeLocker) Stop

func (f *FakeLocker) Stop() error

func (*FakeLocker) Unlock

func (f *FakeLocker) Unlock(_ context.Context, key string) error

func (*FakeLocker) WatchServices

func (f *FakeLocker) WatchServices(ctx context.Context, _ string, _ []string, ch chan<- []*lockers.Service, _ time.Duration) error

Jump to

Keyboard shortcuts

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