guardcontract

package
v0.300.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Timeout = testcase.Var[time.Duration]{
	ID: "assertion Timeout.Get(t)",
	Init: func(t *testcase.T) time.Duration {
		return time.Second
	},
}

Functions

func Locker

func Locker(subject guard.Locker, opts ...LockerOption) contract.Contract

func LockerFactory

func LockerFactory[Key comparable](subject guard.LockerFactory[Key], opts ...LockerFactoryOption[Key]) contract.Contract

func NonBlockingLocker

func NonBlockingLocker(subject guard.NonBlockingLocker, opts ...LockerOption) contract.Contract

func NonBlockingLockerFactory

func NonBlockingLockerFactory[Key comparable](subject guard.NonBlockingLockerFactory[Key], opts ...LockerFactoryOption[Key]) contract.Contract

func Unlocker

func Unlocker(subject guard.Unlocker, lock func(context.Context) (context.Context, error), opts ...LockerOption) contract.Contract

Types

type LockerConfig

type LockerConfig struct {
	MakeContext func(testing.TB) context.Context
	Waiter      assert.Waiter
}

func (LockerConfig) Configure

func (c LockerConfig) Configure(t *LockerConfig)

func (*LockerConfig) Init

func (c *LockerConfig) Init()

type LockerFactoryConfig

type LockerFactoryConfig[Key comparable] struct {
	MakeKey func(testing.TB) Key
	LockerConfig
}

func (LockerFactoryConfig[Key]) Configure

func (c LockerFactoryConfig[Key]) Configure(t *LockerFactoryConfig[Key])

func (*LockerFactoryConfig[Key]) Init

func (c *LockerFactoryConfig[Key]) Init()

type LockerFactoryOption

type LockerFactoryOption[Key comparable] interface {
	option.Option[LockerFactoryConfig[Key]]
}

type LockerOption

type LockerOption interface {
	option.Option[LockerConfig]
}

Jump to

Keyboard shortcuts

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