routing

package
v0.0.0-...-d386c04 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConditionExpressionDivider = "::"
	ConditionExpressionAny     = "any"
	ConditionExpressionEqual   = "equal"
	ConditionExpressionPrefix  = "prefix"
)
View Source
var (
	ErrConditionExpressionMalformed = errors.New("ROUTING.CONDITION.EXPRESSION.MALFORMED.ERROR")
	ErrConditionExpressionUnknown   = errors.New("ROUTING.CONDITION.EXPRESSION.UNKNOWN.ERROR")
)
View Source
var (
	ConditionSourceType  = "type"
	ConditionSourceAppId = "app_id"
)

Functions

func ConditionExpression

func ConditionExpression(rule *entities.EndpointRule) (func(source string) bool, error)

func ConditionSource

func ConditionSource(rule *entities.EndpointRule, msg *entities.Message) string

func MatchAny

func MatchAny() string

func MatchEqual

func MatchEqual(value string) string

func MatchPrefix

func MatchPrefix(value string) string

func NewRequest

func NewRequest(
	timer timer.Timer,
	msg *entities.Message,
	ep *entities.Endpoint,
	epr *entities.EndpointRule,
) *entities.Request

func PlanRequest

func PlanRequest(
	timer timer.Timer,
	msg *entities.Message,
	route *Route,
) (*entities.Request, []any)

func PlanRequests

func PlanRequests(
	timer timer.Timer,
	msg *entities.Message,
	routes []Route,
) (map[string]*entities.Request, [][]any)

Types

type Route

type Route struct {
	Endpoint *entities.Endpoint
	Rules    []entities.EndpointRule
}

Jump to

Keyboard shortcuts

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