router

package
v5.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalancingRule

type BalancingRule struct {
	Tag         string               `json:"tag"`
	Selectors   cfgcommon.StringList `json:"selector"`
	Strategy    StrategyConfig       `json:"strategy"`
	FallbackTag string               `json:"fallbackTag"`
}

func (*BalancingRule) Build

func (r *BalancingRule) Build() (*router.BalancingRule, error)

Build builds the balancing rule

type HealthCheckSettings

type HealthCheckSettings struct {
	Destination   string            `json:"destination"`
	Connectivity  string            `json:"connectivity"`
	Interval      duration.Duration `json:"interval"`
	SamplingCount int               `json:"sampling"`
	Timeout       duration.Duration `json:"timeout"`
}

HealthCheckSettings holds settings for health Checker

func (HealthCheckSettings) Build

func (h HealthCheckSettings) Build() (proto.Message, error)

type RouterConfig

type RouterConfig struct {
	Settings       *RouterRulesConfig `json:"settings"` // Deprecated
	RuleList       []json.RawMessage  `json:"rules"`
	DomainStrategy *string            `json:"domainStrategy"`
	Balancers      []*BalancingRule   `json:"balancers"`

	DomainMatcher string `json:"domainMatcher"`
	// contains filtered or unexported fields
}

func (*RouterConfig) Build

func (c *RouterConfig) Build() (*router.Config, error)

func (*RouterConfig) BuildV5

func (c *RouterConfig) BuildV5(ctx context.Context) (*router.Config, error)

type RouterRulesConfig

type RouterRulesConfig struct {
	RuleList       []json.RawMessage `json:"rules"`
	DomainStrategy string            `json:"domainStrategy"`
}

type StrategyConfig

type StrategyConfig struct {
	Type     string           `json:"type"`
	Settings *json.RawMessage `json:"settings"`
}

StrategyConfig represents a strategy config

Jump to

Keyboard shortcuts

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