selector

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Next

type Next func() (*registry.Node, error)

Next return registry.Node

func RoundRobin

func RoundRobin(services *registry.Service) Next

RoundRobin strategy

type Option

type Option func(*Options)

Option struct

func WithRegistry

func WithRegistry(registry registry.Registry) Option

WithRegistry set registry option

func WithStrategy

func WithStrategy(strategy Strategy) Option

WithStrategy set strategy option

type Options

type Options struct {
	Registry registry.Registry
	Strategy Strategy
}

Options struct

type Selector

type Selector interface {
	Select(context.Context, string) (Next, error)
	String() string
}

Selector interface

func NewSelector

func NewSelector(opts ...Option) Selector

NewSelector select

type Strategy

type Strategy func(services *registry.Service) Next

Strategy type

Jump to

Keyboard shortcuts

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