routing

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPriority added in v0.14.0

func GetPriority(params map[string]string) int

GetPriority extract priority from config params. Small numbers represent more important routers.

func NewParamNeededErr added in v0.14.0

func NewParamNeededErr(param, routing string) error

func RoutingFromConfig added in v0.14.0

func RoutingFromConfig(c config.Router) (routing.Routing, error)

RoutingFromConfig creates a Routing instance from the specified configuration.

Types

type ParamNeededError added in v0.14.0

type ParamNeededError struct {
	ParamName  string
	RouterType string
}

func (*ParamNeededError) Error added in v0.14.0

func (e *ParamNeededError) Error() string

type ProvideMany added in v0.14.0

type ProvideMany interface {
	ProvideMany(ctx context.Context, keys []multihash.Multihash) error
	Ready() bool
}

type ProvideManyWrapper added in v0.14.0

type ProvideManyWrapper struct {
	// contains filtered or unexported fields
}

func (*ProvideManyWrapper) ProvideMany added in v0.14.0

func (pmw *ProvideManyWrapper) ProvideMany(ctx context.Context, keys []multihash.Multihash) error

func (*ProvideManyWrapper) Ready added in v0.14.0

func (pmw *ProvideManyWrapper) Ready() bool

Ready is ready if all providers are ready

type RouterTypeNotFoundError added in v0.14.0

type RouterTypeNotFoundError struct {
	RouterType string
}

func (*RouterTypeNotFoundError) Error added in v0.14.0

func (e *RouterTypeNotFoundError) Error() string

type Tiered added in v0.14.0

type Tiered struct {
	routinghelpers.Tiered
}

Tiered is a routing Tiered implementation providing some extra methods to fill some special use cases when initializing the client.

func (Tiered) ProvideMany added in v0.14.0

func (ds Tiered) ProvideMany() ProvideMany

ProvideMany returns a ProvideMany implementation including all Routers that implements ProvideMany

type TieredRouter added in v0.14.0

type TieredRouter interface {
	routing.Routing
	ProvideMany() ProvideMany
}

Jump to

Keyboard shortcuts

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