containers

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

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 added in v1.0.3

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 added in v1.0.3

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 added in v1.0.3

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 added in v1.0.3

Get returns the object stored at a certain key. Returns an error if the element does not exist

func (*ResolversContainer) Len added in v1.0.3

func (rc *ResolversContainer) Len() int

Len returns the length of the added objects

func (*ResolversContainer) Remove added in v1.0.3

func (rc *ResolversContainer) Remove(key string)

Remove will remove an object at a given key

func (*ResolversContainer) Replace added in v1.0.3

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

Jump to

Keyboard shortcuts

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