Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ICache ¶
type ICache[K comparable, V any] interface { // Destroy marks this cache as destroyed and cancel all pending outcomes. Destroy() // GetOutcome returns the outcome associated with the given key. GetOutcome(key K) IOutcome[V] // Complete the outcome associated with the given key using the given result. Complete(key K, val V, err error) }
ICache is an in-memory cache of outcome associated with specific keys.
type IOutcome ¶
type IOutcome[V any] interface { // Get blocks and waits for the outcome to complete and then returns the result. Get(ctx context.Context) (V, error) // contains filtered or unexported methods }
IOutcome is a promise for a future outcome.
type MockICache ¶
type MockICache[K comparable, V interface{}] struct { mock.Mock }
MockICache is an autogenerated mock type for the ICache type
func NewMockICache ¶
func NewMockICache[K comparable, V interface{}](t mockConstructorTestingTNewMockICache) *MockICache[K, V]
NewMockICache creates a new instance of MockICache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockICache[K, V]) Complete ¶
func (_m *MockICache[K, V]) Complete(key K, val V, err error)
Complete provides a mock function with given fields: key, val, err
func (*MockICache[K, V]) Destroy ¶
func (_m *MockICache[K, V]) Destroy()
Destroy provides a mock function with given fields:
func (*MockICache[K, V]) GetOutcome ¶
func (_m *MockICache[K, V]) GetOutcome(key K) IOutcome[V]
GetOutcome provides a mock function with given fields: key
type MockIOutcome ¶
MockIOutcome is an autogenerated mock type for the IOutcome type
func NewMockIOutcome ¶
func NewMockIOutcome[V interface{}](t mockConstructorTestingTNewMockIOutcome) *MockIOutcome[V]
NewMockIOutcome creates a new instance of MockIOutcome. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.