router

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	NamespaceID string
}

type Dest

type Dest struct {
	DestId       string     `yaml:"destId"`
	DestWeight   int64      `yaml:"destWeight"`
	DestItemList []DestItem `yaml:"destItemList"`
	RouteRuleId  string     `yaml:"routeRuleId"`
}

type DestItem

type DestItem struct {
	RouteDestItemId string `yaml:"routeDestItemId"`
	RouteDestId     string `yaml:"routeDestId"`
	DestItemField   string `yaml:"destItemField"`
	DestItemValue   string `yaml:"destItemValue"`
}

type Router

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

func DefaultRouter

func DefaultRouter() *Router

func New

func New(conf *Config, cfg config.Source) *Router

func (*Router) Close

func (r *Router) Close()

func (*Router) Select

func (r *Router) Select(ctx context.Context, svc naming.Service, nodes []naming.Instance) (selects []naming.Instance)

type Rule

type Rule struct {
	RouteRuleId string    `yaml:"routeRuleId"`
	RouteId     string    `yaml:"routeId"`
	TagList     []TagRule `yaml:"tagList"`
	DestList    []Dest    `yaml:"destList"`
}

type RuleGroup

type RuleGroup struct {
	RouteId          string `yaml:"routeId"`
	RouteName        string `yaml:"routeName"`
	RouteDesc        string `yaml:"routeDesc"`
	MicroserivceId   string `yaml:"microserivceId"`
	RuleList         []Rule `yaml:"ruleList"`
	NamespaceId      string `yaml:"namespaceId"`
	MicroserviceName string `yaml:"microserviceName"`
	FallbackStatus   bool   `yaml:"fallbackStatus"`
}

type TagRule

type TagRule struct {
	TagID       string `yaml:"tagID"`
	TagType     string `yaml:"tagType"`
	TagField    string `yaml:"tagField"`
	TagOperator string `yaml:"tagOperator"`
	TagValue    string `yaml:"tagValue"`
	RouteRuleId string `yaml:"routeRuleId"`
}

Jump to

Keyboard shortcuts

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