Documentation ¶
Index ¶
- func NewResolversFinder(container dataRetriever.ResolversContainer, coordinator sharding.Coordinator) (*resolversFinder, error)
- type ResolversContainer
- func (rc *ResolversContainer) Add(key string, resolver dataRetriever.Resolver) error
- func (rc *ResolversContainer) AddMultiple(keys []string, resolvers []dataRetriever.Resolver) error
- func (rc *ResolversContainer) Get(key string) (dataRetriever.Resolver, error)
- func (rc *ResolversContainer) Len() int
- func (rc *ResolversContainer) Remove(key string)
- func (rc *ResolversContainer) Replace(key string, resolver dataRetriever.Resolver) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResolversFinder ¶
func NewResolversFinder(container dataRetriever.ResolversContainer, coordinator sharding.Coordinator) (*resolversFinder, error)
NewResolversFinder creates a new resolversFinder object
Types ¶
type ResolversContainer ¶
type ResolversContainer struct {
// contains filtered or unexported fields
}
ResolversContainer is a resolvers holder organized by type
func NewResolversContainer ¶
func NewResolversContainer() *ResolversContainer
NewResolversContainer will create a new instance of a container
func (*ResolversContainer) Add ¶
func (rc *ResolversContainer) Add(key string, resolver dataRetriever.Resolver) error
Add will add an object at a given key. Returns an error if the element already exists
func (*ResolversContainer) AddMultiple ¶
func (rc *ResolversContainer) AddMultiple(keys []string, resolvers []dataRetriever.Resolver) error
AddMultiple will add objects with given keys. Returns an error if one element already exists, lengths mismatch or an interceptor is nil
func (*ResolversContainer) Get ¶
func (rc *ResolversContainer) Get(key string) (dataRetriever.Resolver, error)
Get returns the object stored at a certain key. Returns an error if the element does not exist
func (*ResolversContainer) Len ¶
func (rc *ResolversContainer) Len() int
Len returns the length of the added objects
func (*ResolversContainer) Remove ¶
func (rc *ResolversContainer) Remove(key string)
Remove will remove an object at a given key
func (*ResolversContainer) Replace ¶
func (rc *ResolversContainer) Replace(key string, resolver dataRetriever.Resolver) error
Replace will add (or replace if it already exists) an object at a given key