servicegetter

package
v2.20.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module is a set of default providers for servicegetter components.

Functions

This section is empty.

Types

type FxIn

type FxIn struct {
	fx.In
	Lifecycle      fx.Lifecycle
	Entities       *entities.Entities
	EntityTrackers *entities.EntityTrackers
	Metrics        *Metrics `optional:"true"`
}

FxIn are FX arguments to ProvideFromEntities.

type Metrics

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

Metrics is used for collecting metrics about servicegetter

nil value of Metrics should be always usable.

func NewMetrics

func NewMetrics(registry *prometheus.Registry) (*Metrics, error)

NewMetrics creates new Metrics, registering counters in given registry.

type ServiceGetter

type ServiceGetter interface {
	ServicesFromContext(ctx context.Context) []string
	ServicesFromSocketAddress(addr *corev3.SocketAddress) []string
	ServicesFromAddress(addr string) []string
	ParseServicesFromString(sourceAddress string) ([]string, string)
	ParseServicesFromAddress(addr *corev3.SocketAddress) ([]string, string)
}

ServiceGetter can be used to query services based on client context.

Caller should not modify slices returned from methods of ServiceGetter.

func FromEntities

func FromEntities(ec *entities.Entities) ServiceGetter

FromEntities creates a new Entities-powered ServiceGetter.

func NewEmpty

func NewEmpty() ServiceGetter

NewEmpty creates a new ServiceGetter that always returns nil.

func ProvideFromEntities

func ProvideFromEntities(in FxIn) ServiceGetter

ProvideFromEntities provides an Entities-powered ServiceGetter.

Jump to

Keyboard shortcuts

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