extras

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FastestResponseFanIn

type FastestResponseFanIn struct {
	fiber.BaseFanIn
}

FastestResponseFanIn is a FanIn that selects a first (fastest) OK response from the channel of responseQueue

func (*FastestResponseFanIn) Aggregate

Aggregate returns the first (fastest) response from the result channel

type RandomRoutingStrategy

type RandomRoutingStrategy struct {
	fiber.BaseFiberType
}

RandomRoutingStrategy is just a reference implementation of a RoutingStrategy. It randomly selects a primary route and all other routes are fallbacks (with no specific order)

func (*RandomRoutingStrategy) SelectRoute

func (s *RandomRoutingStrategy) SelectRoute(
	_ context.Context,
	_ fiber.Request,
	routes map[string]fiber.Component,
) (route fiber.Component, fallbacks []fiber.Component, labels fiber.Labels, err error)

SelectRoute on the RandomRoutingStrategy selects one of the given routes as the primary route, at random, and sets the others as fallbacks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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