Documentation
¶
Index ¶
- type DefaultService
- type Key
- type LRUMemoryCache
- func (p *LRUMemoryCache) Allocated() int
- func (p *LRUMemoryCache) Contains(key Key) bool
- func (p *LRUMemoryCache) Delete(key Key) bool
- func (p *LRUMemoryCache) Get(key Key) (Value, bool)
- func (p *LRUMemoryCache) Occupied() int
- func (p *LRUMemoryCache) Peek(key Key) (Value, bool)
- func (p *LRUMemoryCache) Put(key Key, value Value) bool
- func (p *LRUMemoryCache) Replace(key Key, value Value) bool
- type Service
- type ServiceMock
- func (mmGet *ServiceMock) Get(ctx context.Context, stateReference reference.Global) (o1 descriptor.Object, err error)
- func (mmGet *ServiceMock) GetAfterCounter() uint64
- func (mmGet *ServiceMock) GetBeforeCounter() uint64
- func (m *ServiceMock) MinimockFinish()
- func (m *ServiceMock) MinimockGetDone() bool
- func (m *ServiceMock) MinimockGetInspect()
- func (m *ServiceMock) MinimockSetDone() bool
- func (m *ServiceMock) MinimockSetInspect()
- func (m *ServiceMock) MinimockWait(timeout mm_time.Duration)
- func (mmSet *ServiceMock) Set(ctx context.Context, stateReference reference.Global, ...) (err error)
- func (mmSet *ServiceMock) SetAfterCounter() uint64
- func (mmSet *ServiceMock) SetBeforeCounter() uint64
- type ServiceMockGetExpectation
- type ServiceMockGetParams
- type ServiceMockGetResults
- type ServiceMockSetExpectation
- type ServiceMockSetParams
- type ServiceMockSetResults
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultService ¶
type DefaultService struct {
// contains filtered or unexported fields
}
func NewDefaultService ¶
func NewDefaultService() *DefaultService
func (*DefaultService) Get ¶
func (s *DefaultService) Get(ctx context.Context, stateReference reference.Global) (descriptor.Object, error)
func (*DefaultService) Set ¶
func (s *DefaultService) Set(ctx context.Context, stateReference reference.Global, objectDescriptor descriptor.Object) error
type LRUMemoryCache ¶
type LRUMemoryCache struct {
// contains filtered or unexported fields
}
func NewMemoryCache ¶
func NewMemoryCache(cs cachekit.Strategy) *LRUMemoryCache
func (*LRUMemoryCache) Allocated ¶
func (p *LRUMemoryCache) Allocated() int
Allocated returns a total number of cache entries allocated, but some of them may be unused. NB! Cache can only grow.
func (*LRUMemoryCache) Contains ¶
func (p *LRUMemoryCache) Contains(key Key) bool
Contains returns (true) when the key is present. Access to the key is not updated.
func (*LRUMemoryCache) Delete ¶
func (p *LRUMemoryCache) Delete(key Key) bool
Delete removes key and zero out relevant value. Returns (false) when key wasn't present. Access to the key is not updated. Cache entry will become unavailable, but will only be freed after relevant expiry / eviction.
func (*LRUMemoryCache) Get ¶
func (p *LRUMemoryCache) Get(key Key) (Value, bool)
Get returns value and presence flag for the given key. Access to the key is updated when key exists.
func (*LRUMemoryCache) Occupied ¶
func (p *LRUMemoryCache) Occupied() int
Occupied returns a number of added / available cache entries.
func (*LRUMemoryCache) Peek ¶
func (p *LRUMemoryCache) Peek(key Key) (Value, bool)
Peek returns value and presence flag for the given key. Access to the key is not updated.
type ServiceMock ¶
type ServiceMock struct { GetMock mServiceMockGet SetMock mServiceMockSet // contains filtered or unexported fields }
ServiceMock implements Service
func NewServiceMock ¶
func NewServiceMock(t minimock.Tester) *ServiceMock
NewServiceMock returns a mock for Service
func (*ServiceMock) Get ¶
func (mmGet *ServiceMock) Get(ctx context.Context, stateReference reference.Global) (o1 descriptor.Object, err error)
Get implements Service
func (*ServiceMock) GetAfterCounter ¶
func (mmGet *ServiceMock) GetAfterCounter() uint64
GetAfterCounter returns a count of finished ServiceMock.Get invocations
func (*ServiceMock) GetBeforeCounter ¶
func (mmGet *ServiceMock) GetBeforeCounter() uint64
GetBeforeCounter returns a count of ServiceMock.Get invocations
func (*ServiceMock) MinimockFinish ¶
func (m *ServiceMock) MinimockFinish()
MinimockFinish checks that all mocked methods have been called the expected number of times
func (*ServiceMock) MinimockGetDone ¶
func (m *ServiceMock) MinimockGetDone() bool
MinimockGetDone returns true if the count of the Get invocations corresponds the number of defined expectations
func (*ServiceMock) MinimockGetInspect ¶
func (m *ServiceMock) MinimockGetInspect()
MinimockGetInspect logs each unmet expectation
func (*ServiceMock) MinimockSetDone ¶
func (m *ServiceMock) MinimockSetDone() bool
MinimockSetDone returns true if the count of the Set invocations corresponds the number of defined expectations
func (*ServiceMock) MinimockSetInspect ¶
func (m *ServiceMock) MinimockSetInspect()
MinimockSetInspect logs each unmet expectation
func (*ServiceMock) MinimockWait ¶
func (m *ServiceMock) MinimockWait(timeout mm_time.Duration)
MinimockWait waits for all mocked methods to be called the expected number of times
func (*ServiceMock) Set ¶
func (mmSet *ServiceMock) Set(ctx context.Context, stateReference reference.Global, objectDescriptor descriptor.Object) (err error)
Set implements Service
func (*ServiceMock) SetAfterCounter ¶
func (mmSet *ServiceMock) SetAfterCounter() uint64
SetAfterCounter returns a count of finished ServiceMock.Set invocations
func (*ServiceMock) SetBeforeCounter ¶
func (mmSet *ServiceMock) SetBeforeCounter() uint64
SetBeforeCounter returns a count of ServiceMock.Set invocations
type ServiceMockGetExpectation ¶
type ServiceMockGetExpectation struct { Counter uint64 // contains filtered or unexported fields }
ServiceMockGetExpectation specifies expectation struct of the Service.Get
func (*ServiceMockGetExpectation) Then ¶
func (e *ServiceMockGetExpectation) Then(o1 descriptor.Object, err error) *ServiceMock
Then sets up Service.Get return parameters for the expectation previously defined by the When method
type ServiceMockGetParams ¶
type ServiceMockGetParams struct {
// contains filtered or unexported fields
}
ServiceMockGetParams contains parameters of the Service.Get
type ServiceMockGetResults ¶
type ServiceMockGetResults struct {
// contains filtered or unexported fields
}
ServiceMockGetResults contains results of the Service.Get
type ServiceMockSetExpectation ¶
type ServiceMockSetExpectation struct { Counter uint64 // contains filtered or unexported fields }
ServiceMockSetExpectation specifies expectation struct of the Service.Set
func (*ServiceMockSetExpectation) Then ¶
func (e *ServiceMockSetExpectation) Then(err error) *ServiceMock
Then sets up Service.Set return parameters for the expectation previously defined by the When method
type ServiceMockSetParams ¶
type ServiceMockSetParams struct {
// contains filtered or unexported fields
}
ServiceMockSetParams contains parameters of the Service.Set
type ServiceMockSetResults ¶
type ServiceMockSetResults struct {
// contains filtered or unexported fields
}
ServiceMockSetResults contains results of the Service.Set
type Value ¶
type Value = descriptor.Object