registry

package
v0.0.0-...-a602bb6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 11 Imported by: 22 modules, 77 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CONNECTED = PruneStatus(iota)
	DISCONNECTED
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PruneStatus

type PruneStatus int

type Registry

type Registry interface {
	Register(uri route.Uri, endpoint *route.Endpoint)
	Unregister(uri route.Uri, endpoint *route.Endpoint)
	Lookup(uri route.Uri) *route.EndpointPool
	LookupWithAppInstance(uri route.Uri, appID, appIndex string) *route.EndpointPool
	LookupWithProcessInstance(uri route.Uri, processID, processIndex string) *route.EndpointPool
}

type RouteRegistry

type RouteRegistry struct {
	sync.RWMutex

	EmptyPoolTimeout              time.Duration
	EmptyPoolResponseCode503      bool
	DefaultLoadBalancingAlgorithm string
	// contains filtered or unexported fields
}

func NewRouteRegistry

func NewRouteRegistry(logger *slog.Logger, c *config.Config, reporter metrics.MetricReporter) *RouteRegistry

func (*RouteRegistry) Lookup

func (r *RouteRegistry) Lookup(uri route.Uri) *route.EndpointPool

func (*RouteRegistry) LookupWithAppInstance

func (r *RouteRegistry) LookupWithAppInstance(uri route.Uri, appID string, appIndex string) *route.EndpointPool

func (*RouteRegistry) LookupWithProcessInstance

func (r *RouteRegistry) LookupWithProcessInstance(uri route.Uri, processID string, processIndex string) *route.EndpointPool

func (*RouteRegistry) MSSinceLastUpdate

func (r *RouteRegistry) MSSinceLastUpdate() int64

func (*RouteRegistry) MarshalJSON

func (r *RouteRegistry) MarshalJSON() ([]byte, error)

func (*RouteRegistry) NumEndpoints

func (r *RouteRegistry) NumEndpoints() int

func (*RouteRegistry) NumUris

func (registry *RouteRegistry) NumUris() int

func (*RouteRegistry) Register

func (r *RouteRegistry) Register(uri route.Uri, endpoint *route.Endpoint)

func (*RouteRegistry) SetTimeOfLastUpdate

func (r *RouteRegistry) SetTimeOfLastUpdate(t time.Time)

func (*RouteRegistry) StartPruningCycle

func (r *RouteRegistry) StartPruningCycle()

func (*RouteRegistry) StopPruningCycle

func (r *RouteRegistry) StopPruningCycle()

func (*RouteRegistry) SuspendPruning

func (r *RouteRegistry) SuspendPruning(f func() bool)

func (*RouteRegistry) TimeOfLastUpdate

func (r *RouteRegistry) TimeOfLastUpdate() time.Time

func (*RouteRegistry) Unregister

func (r *RouteRegistry) Unregister(uri route.Uri, endpoint *route.Endpoint)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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