routing

package
v1.13.5 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MatchAll = "*"
)

Variables

This section is empty.

Functions

func BuildInBoundsFromV2

func BuildInBoundsFromV2(service, namespace string, item *v2.ExtendRoutingConfig) []*apiv1.Route

BuildInBoundsFromV2 将 v2 的路由规则转为 v1 的路由规则中的 InBounds

func BuildOutBoundsFromV2

func BuildOutBoundsFromV2(service, namespace string, item *v2.ExtendRoutingConfig) []*apiv1.Route

BuildOutBoundsFromV2 根据 v2 版本的路由规则适配成 v1 版本的路由规则中的 OutBounds

func BuildV1RoutesFromV2

func BuildV1RoutesFromV2(service, namespace string, entries []*v2.ExtendRoutingConfig) ([]*apiv1.Route, []*apiv1.Route, []string)

BuildV1RoutesFromV2 根据 v2 版本的路由规则适配成 v1 版本的路由规则,分为别 inBounds 以及 outBounds return inBound outBound revisions

func BuildV2ExtendRouting

func BuildV2ExtendRouting(req *apiv1.Routing, route *apiv1.Route) (*v2.ExtendRoutingConfig, error)

BuildV2ExtendRouting 构建 v2 版本的内部数据对象路由规则

func BuildV2RoutingFromV1Route

func BuildV2RoutingFromV1Route(req *apiv1.Routing, route *apiv1.Route) (*apiv2.Routing, error)

BuildV2RoutingFromV1Route 构建 v2 版本的API数据对象路由规则

func CompareRoutingV2

func CompareRoutingV2(a, b *v2.ExtendRoutingConfig) bool

CompareRoutingV2 比较两个路由的优先级。

func CompositeRoutingV1AndV2

func CompositeRoutingV1AndV2(v1rule *apiv1.Routing, level1, level2,
	level3 []*v2.ExtendRoutingConfig) (*apiv1.Routing, []string)

CompositeRoutingV1AndV2 合并 v1 版本的路由规则以及 v2 版本的规则路由

func ConvertRoutingV1ToExtendV2

func ConvertRoutingV1ToExtendV2(svcName, svcNamespace string, rule *model.RoutingConfig) ([]*v2.ExtendRoutingConfig, []*v2.ExtendRoutingConfig, error)

ConvertRoutingV1ToExtendV2 v1 版本的路由规则转为 v2 版本进行存储

func ConvertV1RouteToV2Route

func ConvertV1RouteToV2Route(route *apiv1.Route) *apiv2.RuleRoutingConfig

ConvertV1RouteToV2Route 将 v1 版本的路由规则转为 v2 版本的路由规则

func RoutingArguments2Labels

func RoutingArguments2Labels(args []*apiv2.SourceMatch) map[string]*apiv1.MatchString

RoutingArguments2Labels 将参数列表适配成旧的标签模型

func RoutingConfigV1ToAPI

func RoutingConfigV1ToAPI(req *model.RoutingConfig, service string, namespace string) (*apiv1.Routing, error)

RoutingConfigV1ToAPI 把内部数据结构转换为API参数传递出去

func RoutingLabels2Arguments

func RoutingLabels2Arguments(labels map[string]*apiv1.MatchString) []*apiv2.SourceMatch

RoutingLabels2Arguments 将旧的标签模型适配成参数列表

Types

This section is empty.

Jump to

Keyboard shortcuts

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