Documentation
¶
Index ¶
- Variables
- type Cache
- type ContentClaimsCache
- type ContentClaimsStore
- type ContextID
- type EncodedContextID
- type Getter
- type Match
- type MockContentClaimsCache
- func (_m *MockContentClaimsCache) EXPECT() *MockContentClaimsCache_Expecter
- func (_m *MockContentClaimsCache) Get(ctx context.Context, key cid.Cid) (delegation.Delegation, error)
- func (_m *MockContentClaimsCache) Set(ctx context.Context, key cid.Cid, value delegation.Delegation, expires bool) error
- func (_m *MockContentClaimsCache) SetExpirable(ctx context.Context, key cid.Cid, expires bool) error
- type MockContentClaimsCache_Expecter
- func (_e *MockContentClaimsCache_Expecter) Get(ctx interface{}, key interface{}) *MockContentClaimsCache_Get_Call
- func (_e *MockContentClaimsCache_Expecter) Set(ctx interface{}, key interface{}, value interface{}, expires interface{}) *MockContentClaimsCache_Set_Call
- func (_e *MockContentClaimsCache_Expecter) SetExpirable(ctx interface{}, key interface{}, expires interface{}) *MockContentClaimsCache_SetExpirable_Call
- type MockContentClaimsCache_Get_Call
- func (_c *MockContentClaimsCache_Get_Call) Return(_a0 delegation.Delegation, _a1 error) *MockContentClaimsCache_Get_Call
- func (_c *MockContentClaimsCache_Get_Call) Run(run func(ctx context.Context, key cid.Cid)) *MockContentClaimsCache_Get_Call
- func (_c *MockContentClaimsCache_Get_Call) RunAndReturn(run func(context.Context, cid.Cid) (delegation.Delegation, error)) *MockContentClaimsCache_Get_Call
- type MockContentClaimsCache_SetExpirable_Call
- func (_c *MockContentClaimsCache_SetExpirable_Call) Return(_a0 error) *MockContentClaimsCache_SetExpirable_Call
- func (_c *MockContentClaimsCache_SetExpirable_Call) Run(run func(ctx context.Context, key cid.Cid, expires bool)) *MockContentClaimsCache_SetExpirable_Call
- func (_c *MockContentClaimsCache_SetExpirable_Call) RunAndReturn(run func(context.Context, cid.Cid, bool) error) *MockContentClaimsCache_SetExpirable_Call
- type MockContentClaimsCache_Set_Call
- func (_c *MockContentClaimsCache_Set_Call) Return(_a0 error) *MockContentClaimsCache_Set_Call
- func (_c *MockContentClaimsCache_Set_Call) Run(...) *MockContentClaimsCache_Set_Call
- func (_c *MockContentClaimsCache_Set_Call) RunAndReturn(run func(context.Context, cid.Cid, delegation.Delegation, bool) error) *MockContentClaimsCache_Set_Call
- type MockContentClaimsStore
- type MockContentClaimsStore_Expecter
- type MockContentClaimsStore_Get_Call
- func (_c *MockContentClaimsStore_Get_Call) Return(_a0 delegation.Delegation, _a1 error) *MockContentClaimsStore_Get_Call
- func (_c *MockContentClaimsStore_Get_Call) Run(run func(ctx context.Context, key ipld.Link)) *MockContentClaimsStore_Get_Call
- func (_c *MockContentClaimsStore_Get_Call) RunAndReturn(run func(context.Context, ipld.Link) (delegation.Delegation, error)) *MockContentClaimsStore_Get_Call
- type MockContentClaimsStore_Put_Call
- func (_c *MockContentClaimsStore_Put_Call) Return(_a0 error) *MockContentClaimsStore_Put_Call
- func (_c *MockContentClaimsStore_Put_Call) Run(run func(ctx context.Context, key ipld.Link, value delegation.Delegation)) *MockContentClaimsStore_Put_Call
- func (_c *MockContentClaimsStore_Put_Call) RunAndReturn(run func(context.Context, ipld.Link, delegation.Delegation) error) *MockContentClaimsStore_Put_Call
- type MockProviderStore
- func (_m *MockProviderStore) Add(ctx context.Context, key multihash.Multihash, values ...model.ProviderResult) (uint64, error)
- func (_m *MockProviderStore) EXPECT() *MockProviderStore_Expecter
- func (_m *MockProviderStore) Members(ctx context.Context, key multihash.Multihash) ([]model.ProviderResult, error)
- func (_m *MockProviderStore) SetExpirable(ctx context.Context, key multihash.Multihash, expires bool) error
- type MockProviderStore_Add_Call
- type MockProviderStore_Expecter
- func (_e *MockProviderStore_Expecter) Add(ctx interface{}, key interface{}, values ...interface{}) *MockProviderStore_Add_Call
- func (_e *MockProviderStore_Expecter) Members(ctx interface{}, key interface{}) *MockProviderStore_Members_Call
- func (_e *MockProviderStore_Expecter) SetExpirable(ctx interface{}, key interface{}, expires interface{}) *MockProviderStore_SetExpirable_Call
- type MockProviderStore_Members_Call
- func (_c *MockProviderStore_Members_Call) Return(_a0 []model.ProviderResult, _a1 error) *MockProviderStore_Members_Call
- func (_c *MockProviderStore_Members_Call) Run(run func(ctx context.Context, key multihash.Multihash)) *MockProviderStore_Members_Call
- func (_c *MockProviderStore_Members_Call) RunAndReturn(run func(context.Context, multihash.Multihash) ([]model.ProviderResult, error)) *MockProviderStore_Members_Call
- type MockProviderStore_SetExpirable_Call
- func (_c *MockProviderStore_SetExpirable_Call) Return(_a0 error) *MockProviderStore_SetExpirable_Call
- func (_c *MockProviderStore_SetExpirable_Call) Run(run func(ctx context.Context, key multihash.Multihash, expires bool)) *MockProviderStore_SetExpirable_Call
- func (_c *MockProviderStore_SetExpirable_Call) RunAndReturn(run func(context.Context, multihash.Multihash, bool) error) *MockProviderStore_SetExpirable_Call
- type MockService
- func (_m *MockService) Cache(ctx context.Context, provider peer.AddrInfo, claim delegation.Delegation) error
- func (_m *MockService) EXPECT() *MockService_Expecter
- func (_m *MockService) Get(ctx context.Context, claim ipld.Link) (delegation.Delegation, error)
- func (_m *MockService) Publish(ctx context.Context, claim delegation.Delegation) error
- func (_m *MockService) Query(ctx context.Context, q Query) (QueryResult, error)
- type MockService_Cache_Call
- type MockService_Expecter
- func (_e *MockService_Expecter) Cache(ctx interface{}, provider interface{}, claim interface{}) *MockService_Cache_Call
- func (_e *MockService_Expecter) Get(ctx interface{}, claim interface{}) *MockService_Get_Call
- func (_e *MockService_Expecter) Publish(ctx interface{}, claim interface{}) *MockService_Publish_Call
- func (_e *MockService_Expecter) Query(ctx interface{}, q interface{}) *MockService_Query_Call
- type MockService_Get_Call
- func (_c *MockService_Get_Call) Return(_a0 delegation.Delegation, _a1 error) *MockService_Get_Call
- func (_c *MockService_Get_Call) Run(run func(ctx context.Context, claim ipld.Link)) *MockService_Get_Call
- func (_c *MockService_Get_Call) RunAndReturn(run func(context.Context, ipld.Link) (delegation.Delegation, error)) *MockService_Get_Call
- type MockService_Publish_Call
- func (_c *MockService_Publish_Call) Return(_a0 error) *MockService_Publish_Call
- func (_c *MockService_Publish_Call) Run(run func(ctx context.Context, claim delegation.Delegation)) *MockService_Publish_Call
- func (_c *MockService_Publish_Call) RunAndReturn(run func(context.Context, delegation.Delegation) error) *MockService_Publish_Call
- type MockService_Query_Call
- func (_c *MockService_Query_Call) Return(_a0 QueryResult, _a1 error) *MockService_Query_Call
- func (_c *MockService_Query_Call) Run(run func(ctx context.Context, q Query)) *MockService_Query_Call
- func (_c *MockService_Query_Call) RunAndReturn(run func(context.Context, Query) (QueryResult, error)) *MockService_Query_Call
- type ProviderStore
- type Publisher
- type Querier
- type Query
- type QueryResult
- type QueryType
- type Service
- type ShardedDagIndexStore
- type Store
- type ValueSetCache
Constants ¶
This section is empty.
Variables ¶
var ErrKeyNotFound = errors.New("key not found")
ErrKeyNotFound means the key did not exist in the cache
var ErrNoRootBlock = errors.New("query root block not found in car")
ErrNoRootBlock indicates a root that is specified but not found in a CAR file
var ErrWrongRootCount = errors.New("query result should have exactly one root")
ErrWrongRootCount indicates a car file with multiple roots being unable to interpret as a query result
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[Key, Value any] interface { Set(ctx context.Context, key Key, value Value, expires bool) error SetExpirable(ctx context.Context, key Key, expires bool) error Get(ctx context.Context, key Key) (Value, error) }
Cache describes a generic cache interface
type ContentClaimsCache ¶ added in v1.0.0
type ContentClaimsCache Cache[cid.Cid, delegation.Delegation]
ContentClaimsCache caches fetched content claims
type ContentClaimsStore ¶
type ContentClaimsStore Store[ipld.Link, delegation.Delegation]
ContentClaimsStore stores published content claims
type ContextID ¶
ContextID describes the data used to calculate a context id for IPNI
func (ContextID) ToEncoded ¶
func (c ContextID) ToEncoded() (EncodedContextID, error)
ToEncoded canonically encodes ContextID data
type EncodedContextID ¶
type EncodedContextID []byte
EncodedContextID is the encoded form of context id data that is actually stored in IPNI
type Getter ¶ added in v1.0.0
type Getter interface { // Get retrieves a claim that has been published or cached by the // indexing service. No external sources are consulted. Get(ctx context.Context, claim ipld.Link) (delegation.Delegation, error) }
type Match ¶ added in v1.0.0
Match narrows parameters for locating providers/claims for a set of multihashes
type MockContentClaimsCache ¶ added in v1.2.1
MockContentClaimsCache is an autogenerated mock type for the ContentClaimsCache type
func NewMockContentClaimsCache ¶ added in v1.2.1
func NewMockContentClaimsCache(t interface { mock.TestingT Cleanup(func()) }) *MockContentClaimsCache
NewMockContentClaimsCache creates a new instance of MockContentClaimsCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockContentClaimsCache) EXPECT ¶ added in v1.2.1
func (_m *MockContentClaimsCache) EXPECT() *MockContentClaimsCache_Expecter
func (*MockContentClaimsCache) Get ¶ added in v1.2.1
func (_m *MockContentClaimsCache) Get(ctx context.Context, key cid.Cid) (delegation.Delegation, error)
Get provides a mock function with given fields: ctx, key
func (*MockContentClaimsCache) Set ¶ added in v1.2.1
func (_m *MockContentClaimsCache) Set(ctx context.Context, key cid.Cid, value delegation.Delegation, expires bool) error
Set provides a mock function with given fields: ctx, key, value, expires
func (*MockContentClaimsCache) SetExpirable ¶ added in v1.2.1
func (_m *MockContentClaimsCache) SetExpirable(ctx context.Context, key cid.Cid, expires bool) error
SetExpirable provides a mock function with given fields: ctx, key, expires
type MockContentClaimsCache_Expecter ¶ added in v1.2.1
type MockContentClaimsCache_Expecter struct {
// contains filtered or unexported fields
}
func (*MockContentClaimsCache_Expecter) Get ¶ added in v1.2.1
func (_e *MockContentClaimsCache_Expecter) Get(ctx interface{}, key interface{}) *MockContentClaimsCache_Get_Call
Get is a helper method to define mock.On call
- ctx context.Context
- key cid.Cid
func (*MockContentClaimsCache_Expecter) Set ¶ added in v1.2.1
func (_e *MockContentClaimsCache_Expecter) Set(ctx interface{}, key interface{}, value interface{}, expires interface{}) *MockContentClaimsCache_Set_Call
Set is a helper method to define mock.On call
- ctx context.Context
- key cid.Cid
- value delegation.Delegation
- expires bool
func (*MockContentClaimsCache_Expecter) SetExpirable ¶ added in v1.2.1
func (_e *MockContentClaimsCache_Expecter) SetExpirable(ctx interface{}, key interface{}, expires interface{}) *MockContentClaimsCache_SetExpirable_Call
SetExpirable is a helper method to define mock.On call
- ctx context.Context
- key cid.Cid
- expires bool
type MockContentClaimsCache_Get_Call ¶ added in v1.2.1
MockContentClaimsCache_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockContentClaimsCache_Get_Call) Return ¶ added in v1.2.1
func (_c *MockContentClaimsCache_Get_Call) Return(_a0 delegation.Delegation, _a1 error) *MockContentClaimsCache_Get_Call
func (*MockContentClaimsCache_Get_Call) Run ¶ added in v1.2.1
func (_c *MockContentClaimsCache_Get_Call) Run(run func(ctx context.Context, key cid.Cid)) *MockContentClaimsCache_Get_Call
func (*MockContentClaimsCache_Get_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockContentClaimsCache_Get_Call) RunAndReturn(run func(context.Context, cid.Cid) (delegation.Delegation, error)) *MockContentClaimsCache_Get_Call
type MockContentClaimsCache_SetExpirable_Call ¶ added in v1.2.1
MockContentClaimsCache_SetExpirable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetExpirable'
func (*MockContentClaimsCache_SetExpirable_Call) Return ¶ added in v1.2.1
func (_c *MockContentClaimsCache_SetExpirable_Call) Return(_a0 error) *MockContentClaimsCache_SetExpirable_Call
func (*MockContentClaimsCache_SetExpirable_Call) Run ¶ added in v1.2.1
func (_c *MockContentClaimsCache_SetExpirable_Call) Run(run func(ctx context.Context, key cid.Cid, expires bool)) *MockContentClaimsCache_SetExpirable_Call
func (*MockContentClaimsCache_SetExpirable_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockContentClaimsCache_SetExpirable_Call) RunAndReturn(run func(context.Context, cid.Cid, bool) error) *MockContentClaimsCache_SetExpirable_Call
type MockContentClaimsCache_Set_Call ¶ added in v1.2.1
MockContentClaimsCache_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set'
func (*MockContentClaimsCache_Set_Call) Return ¶ added in v1.2.1
func (_c *MockContentClaimsCache_Set_Call) Return(_a0 error) *MockContentClaimsCache_Set_Call
func (*MockContentClaimsCache_Set_Call) Run ¶ added in v1.2.1
func (_c *MockContentClaimsCache_Set_Call) Run(run func(ctx context.Context, key cid.Cid, value delegation.Delegation, expires bool)) *MockContentClaimsCache_Set_Call
func (*MockContentClaimsCache_Set_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockContentClaimsCache_Set_Call) RunAndReturn(run func(context.Context, cid.Cid, delegation.Delegation, bool) error) *MockContentClaimsCache_Set_Call
type MockContentClaimsStore ¶ added in v1.2.1
MockContentClaimsStore is an autogenerated mock type for the ContentClaimsStore type
func NewMockContentClaimsStore ¶ added in v1.2.1
func NewMockContentClaimsStore(t interface { mock.TestingT Cleanup(func()) }) *MockContentClaimsStore
NewMockContentClaimsStore creates a new instance of MockContentClaimsStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockContentClaimsStore) EXPECT ¶ added in v1.2.1
func (_m *MockContentClaimsStore) EXPECT() *MockContentClaimsStore_Expecter
func (*MockContentClaimsStore) Get ¶ added in v1.2.1
func (_m *MockContentClaimsStore) Get(ctx context.Context, key ipld.Link) (delegation.Delegation, error)
Get provides a mock function with given fields: ctx, key
func (*MockContentClaimsStore) Put ¶ added in v1.2.1
func (_m *MockContentClaimsStore) Put(ctx context.Context, key ipld.Link, value delegation.Delegation) error
Put provides a mock function with given fields: ctx, key, value
type MockContentClaimsStore_Expecter ¶ added in v1.2.1
type MockContentClaimsStore_Expecter struct {
// contains filtered or unexported fields
}
func (*MockContentClaimsStore_Expecter) Get ¶ added in v1.2.1
func (_e *MockContentClaimsStore_Expecter) Get(ctx interface{}, key interface{}) *MockContentClaimsStore_Get_Call
Get is a helper method to define mock.On call
- ctx context.Context
- key ipld.Link
func (*MockContentClaimsStore_Expecter) Put ¶ added in v1.2.1
func (_e *MockContentClaimsStore_Expecter) Put(ctx interface{}, key interface{}, value interface{}) *MockContentClaimsStore_Put_Call
Put is a helper method to define mock.On call
- ctx context.Context
- key ipld.Link
- value delegation.Delegation
type MockContentClaimsStore_Get_Call ¶ added in v1.2.1
MockContentClaimsStore_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockContentClaimsStore_Get_Call) Return ¶ added in v1.2.1
func (_c *MockContentClaimsStore_Get_Call) Return(_a0 delegation.Delegation, _a1 error) *MockContentClaimsStore_Get_Call
func (*MockContentClaimsStore_Get_Call) Run ¶ added in v1.2.1
func (_c *MockContentClaimsStore_Get_Call) Run(run func(ctx context.Context, key ipld.Link)) *MockContentClaimsStore_Get_Call
func (*MockContentClaimsStore_Get_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockContentClaimsStore_Get_Call) RunAndReturn(run func(context.Context, ipld.Link) (delegation.Delegation, error)) *MockContentClaimsStore_Get_Call
type MockContentClaimsStore_Put_Call ¶ added in v1.2.1
MockContentClaimsStore_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put'
func (*MockContentClaimsStore_Put_Call) Return ¶ added in v1.2.1
func (_c *MockContentClaimsStore_Put_Call) Return(_a0 error) *MockContentClaimsStore_Put_Call
func (*MockContentClaimsStore_Put_Call) Run ¶ added in v1.2.1
func (_c *MockContentClaimsStore_Put_Call) Run(run func(ctx context.Context, key ipld.Link, value delegation.Delegation)) *MockContentClaimsStore_Put_Call
func (*MockContentClaimsStore_Put_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockContentClaimsStore_Put_Call) RunAndReturn(run func(context.Context, ipld.Link, delegation.Delegation) error) *MockContentClaimsStore_Put_Call
type MockProviderStore ¶ added in v1.2.1
MockProviderStore is an autogenerated mock type for the ProviderStore type
func NewMockProviderStore ¶ added in v1.2.1
func NewMockProviderStore(t interface { mock.TestingT Cleanup(func()) }) *MockProviderStore
NewMockProviderStore creates a new instance of MockProviderStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockProviderStore) Add ¶ added in v1.2.1
func (_m *MockProviderStore) Add(ctx context.Context, key multihash.Multihash, values ...model.ProviderResult) (uint64, error)
Add provides a mock function with given fields: ctx, key, values
func (*MockProviderStore) EXPECT ¶ added in v1.2.1
func (_m *MockProviderStore) EXPECT() *MockProviderStore_Expecter
func (*MockProviderStore) Members ¶ added in v1.2.1
func (_m *MockProviderStore) Members(ctx context.Context, key multihash.Multihash) ([]model.ProviderResult, error)
Members provides a mock function with given fields: ctx, key
func (*MockProviderStore) SetExpirable ¶ added in v1.2.1
func (_m *MockProviderStore) SetExpirable(ctx context.Context, key multihash.Multihash, expires bool) error
SetExpirable provides a mock function with given fields: ctx, key, expires
type MockProviderStore_Add_Call ¶ added in v1.2.1
MockProviderStore_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add'
func (*MockProviderStore_Add_Call) Return ¶ added in v1.2.1
func (_c *MockProviderStore_Add_Call) Return(_a0 uint64, _a1 error) *MockProviderStore_Add_Call
func (*MockProviderStore_Add_Call) Run ¶ added in v1.2.1
func (_c *MockProviderStore_Add_Call) Run(run func(ctx context.Context, key multihash.Multihash, values ...model.ProviderResult)) *MockProviderStore_Add_Call
func (*MockProviderStore_Add_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockProviderStore_Add_Call) RunAndReturn(run func(context.Context, multihash.Multihash, ...model.ProviderResult) (uint64, error)) *MockProviderStore_Add_Call
type MockProviderStore_Expecter ¶ added in v1.2.1
type MockProviderStore_Expecter struct {
// contains filtered or unexported fields
}
func (*MockProviderStore_Expecter) Add ¶ added in v1.2.1
func (_e *MockProviderStore_Expecter) Add(ctx interface{}, key interface{}, values ...interface{}) *MockProviderStore_Add_Call
Add is a helper method to define mock.On call
- ctx context.Context
- key multihash.Multihash
- values ...model.ProviderResult
func (*MockProviderStore_Expecter) Members ¶ added in v1.2.1
func (_e *MockProviderStore_Expecter) Members(ctx interface{}, key interface{}) *MockProviderStore_Members_Call
Members is a helper method to define mock.On call
- ctx context.Context
- key multihash.Multihash
func (*MockProviderStore_Expecter) SetExpirable ¶ added in v1.2.1
func (_e *MockProviderStore_Expecter) SetExpirable(ctx interface{}, key interface{}, expires interface{}) *MockProviderStore_SetExpirable_Call
SetExpirable is a helper method to define mock.On call
- ctx context.Context
- key multihash.Multihash
- expires bool
type MockProviderStore_Members_Call ¶ added in v1.2.1
MockProviderStore_Members_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Members'
func (*MockProviderStore_Members_Call) Return ¶ added in v1.2.1
func (_c *MockProviderStore_Members_Call) Return(_a0 []model.ProviderResult, _a1 error) *MockProviderStore_Members_Call
func (*MockProviderStore_Members_Call) Run ¶ added in v1.2.1
func (_c *MockProviderStore_Members_Call) Run(run func(ctx context.Context, key multihash.Multihash)) *MockProviderStore_Members_Call
func (*MockProviderStore_Members_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockProviderStore_Members_Call) RunAndReturn(run func(context.Context, multihash.Multihash) ([]model.ProviderResult, error)) *MockProviderStore_Members_Call
type MockProviderStore_SetExpirable_Call ¶ added in v1.2.1
MockProviderStore_SetExpirable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetExpirable'
func (*MockProviderStore_SetExpirable_Call) Return ¶ added in v1.2.1
func (_c *MockProviderStore_SetExpirable_Call) Return(_a0 error) *MockProviderStore_SetExpirable_Call
func (*MockProviderStore_SetExpirable_Call) Run ¶ added in v1.2.1
func (_c *MockProviderStore_SetExpirable_Call) Run(run func(ctx context.Context, key multihash.Multihash, expires bool)) *MockProviderStore_SetExpirable_Call
func (*MockProviderStore_SetExpirable_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockProviderStore_SetExpirable_Call) RunAndReturn(run func(context.Context, multihash.Multihash, bool) error) *MockProviderStore_SetExpirable_Call
type MockService ¶ added in v1.2.1
MockService is an autogenerated mock type for the Service type
func NewMockService ¶ added in v1.2.1
func NewMockService(t interface { mock.TestingT Cleanup(func()) }) *MockService
NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockService) Cache ¶ added in v1.2.1
func (_m *MockService) Cache(ctx context.Context, provider peer.AddrInfo, claim delegation.Delegation) error
Cache provides a mock function with given fields: ctx, provider, claim
func (*MockService) EXPECT ¶ added in v1.2.1
func (_m *MockService) EXPECT() *MockService_Expecter
func (*MockService) Get ¶ added in v1.2.1
func (_m *MockService) Get(ctx context.Context, claim ipld.Link) (delegation.Delegation, error)
Get provides a mock function with given fields: ctx, claim
func (*MockService) Publish ¶ added in v1.2.1
func (_m *MockService) Publish(ctx context.Context, claim delegation.Delegation) error
Publish provides a mock function with given fields: ctx, claim
func (*MockService) Query ¶ added in v1.2.1
func (_m *MockService) Query(ctx context.Context, q Query) (QueryResult, error)
Query provides a mock function with given fields: ctx, q
type MockService_Cache_Call ¶ added in v1.2.1
MockService_Cache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cache'
func (*MockService_Cache_Call) Return ¶ added in v1.2.1
func (_c *MockService_Cache_Call) Return(_a0 error) *MockService_Cache_Call
func (*MockService_Cache_Call) Run ¶ added in v1.2.1
func (_c *MockService_Cache_Call) Run(run func(ctx context.Context, provider peer.AddrInfo, claim delegation.Delegation)) *MockService_Cache_Call
func (*MockService_Cache_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockService_Cache_Call) RunAndReturn(run func(context.Context, peer.AddrInfo, delegation.Delegation) error) *MockService_Cache_Call
type MockService_Expecter ¶ added in v1.2.1
type MockService_Expecter struct {
// contains filtered or unexported fields
}
func (*MockService_Expecter) Cache ¶ added in v1.2.1
func (_e *MockService_Expecter) Cache(ctx interface{}, provider interface{}, claim interface{}) *MockService_Cache_Call
Cache is a helper method to define mock.On call
- ctx context.Context
- provider peer.AddrInfo
- claim delegation.Delegation
func (*MockService_Expecter) Get ¶ added in v1.2.1
func (_e *MockService_Expecter) Get(ctx interface{}, claim interface{}) *MockService_Get_Call
Get is a helper method to define mock.On call
- ctx context.Context
- claim ipld.Link
func (*MockService_Expecter) Publish ¶ added in v1.2.1
func (_e *MockService_Expecter) Publish(ctx interface{}, claim interface{}) *MockService_Publish_Call
Publish is a helper method to define mock.On call
- ctx context.Context
- claim delegation.Delegation
func (*MockService_Expecter) Query ¶ added in v1.2.1
func (_e *MockService_Expecter) Query(ctx interface{}, q interface{}) *MockService_Query_Call
Query is a helper method to define mock.On call
- ctx context.Context
- q Query
type MockService_Get_Call ¶ added in v1.2.1
MockService_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockService_Get_Call) Return ¶ added in v1.2.1
func (_c *MockService_Get_Call) Return(_a0 delegation.Delegation, _a1 error) *MockService_Get_Call
func (*MockService_Get_Call) Run ¶ added in v1.2.1
func (_c *MockService_Get_Call) Run(run func(ctx context.Context, claim ipld.Link)) *MockService_Get_Call
func (*MockService_Get_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockService_Get_Call) RunAndReturn(run func(context.Context, ipld.Link) (delegation.Delegation, error)) *MockService_Get_Call
type MockService_Publish_Call ¶ added in v1.2.1
MockService_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish'
func (*MockService_Publish_Call) Return ¶ added in v1.2.1
func (_c *MockService_Publish_Call) Return(_a0 error) *MockService_Publish_Call
func (*MockService_Publish_Call) Run ¶ added in v1.2.1
func (_c *MockService_Publish_Call) Run(run func(ctx context.Context, claim delegation.Delegation)) *MockService_Publish_Call
func (*MockService_Publish_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockService_Publish_Call) RunAndReturn(run func(context.Context, delegation.Delegation) error) *MockService_Publish_Call
type MockService_Query_Call ¶ added in v1.2.1
MockService_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query'
func (*MockService_Query_Call) Return ¶ added in v1.2.1
func (_c *MockService_Query_Call) Return(_a0 QueryResult, _a1 error) *MockService_Query_Call
func (*MockService_Query_Call) Run ¶ added in v1.2.1
func (_c *MockService_Query_Call) Run(run func(ctx context.Context, q Query)) *MockService_Query_Call
func (*MockService_Query_Call) RunAndReturn ¶ added in v1.2.1
func (_c *MockService_Query_Call) RunAndReturn(run func(context.Context, Query) (QueryResult, error)) *MockService_Query_Call
type ProviderStore ¶
type ProviderStore ValueSetCache[mh.Multihash, model.ProviderResult]
ProviderStore caches queries to IPNI
type Publisher ¶ added in v1.0.0
type Publisher interface { // Cache caches a claim with the service temporarily. Cache(ctx context.Context, provider peer.AddrInfo, claim delegation.Delegation) error // Publish writes a claim to permanent storage, adds it to an IPNI // advertisement, annnounces it to IPNI nodes and caches it. Publish(ctx context.Context, claim delegation.Delegation) error }
type Querier ¶ added in v1.0.0
type Querier interface { // Query allows claims to be queried by their subject (content CID). It // returns claims as well as any relevant indexes. Query(ctx context.Context, q Query) (QueryResult, error) }
type QueryResult ¶ added in v1.0.0
type QueryResult interface { ipld.View // Claims is a list of links to the root block of claims that can be found in this message Claims() []ipld.Link // Indexes is a list of links to the CID hash of archived sharded dag indexes that can be found in this // message Indexes() []ipld.Link }
QueryResult is an encodable result of a query
type QueryType ¶ added in v1.2.1
type QueryType int
QueryType allows defining which claims a query is targeting. QueryTypeStandard targets all claims, i.e. Location, Index and Equals
func ParseQueryType ¶ added in v1.2.1
type ShardedDagIndexStore ¶
type ShardedDagIndexStore Cache[EncodedContextID, blobindex.ShardedDagIndexView]
ShardedDagIndexStore caches fetched sharded dag indexes
type Store ¶ added in v1.0.0
type Store[Key, Value any] interface { // Put adds (or replaces) an item in the store. Put(ctx context.Context, key Key, value Value) error // Get retrieves an existing item from the store. If the item does not exist, // it should return [ErrKeyNotFound]. Get(ctx context.Context, key Key) (Value, error) }
Store describes a generic storage interface
type ValueSetCache ¶ added in v1.2.1
type ValueSetCache[Key, Value any] interface { Add(ctx context.Context, key Key, values ...Value) (uint64, error) SetExpirable(ctx context.Context, key Key, expires bool) error Members(ctx context.Context, key Key) ([]Value, error) }
ValueSetCache describes a cache interface whose values are sets