servicecomb

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DarkLaunchKey      = "^servicecomb\\.darklaunch\\.policy\\."
	DarkLaunchKeyV2    = "^servicecomb\\.routeRule\\."
	DarkLaunchPrefix   = "servicecomb.darklaunch.policy."
	DarkLaunchPrefixV2 = "servicecomb.routeRule."
	DarkLaunchTypeRule = "RULE"
	DarkLaunchTypeRate = "RATE"
)

constant for route rule keys

Variables

This section is empty.

Functions

func ConvertJSON2RouteRule

func ConvertJSON2RouteRule(raw string) ([]*config.RouteRule, error)

ConvertJSON2RouteRule parse raw json from cse server to route rule config

func DarkLaunchRule2RouteRule

func DarkLaunchRule2RouteRule(rule *config.DarkLaunchRule) []*config.RouteRule

DarkLaunchRule2RouteRule translates dark launch rule to route rule

func MergeLocalAndRemoteConfig

func MergeLocalAndRemoteConfig() (map[string][]*config.RouteRule, error)

MergeLocalAndRemoteConfig get router config from archaius, including local file,memory and config server

func SaveRouteRule

func SaveRouteRule(service string, raw string, isV2 bool)

SaveRouteRule save event rule to local cache

Types

type Router

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

Router is cse router service

func (*Router) DeleteRouteRuleByKey

func (r *Router) DeleteRouteRuleByKey(k string)

DeleteRouteRuleByKey set route rule by key

func (*Router) FetchRouteRuleByServiceName

func (r *Router) FetchRouteRuleByServiceName(service string) []*config.RouteRule

FetchRouteRuleByServiceName get rules for service

func (*Router) Init

func (r *Router) Init(o router.Options) error

Init init router config

func (*Router) ListRouteRule

func (r *Router) ListRouteRule() map[string][]*config.RouteRule

ListRouteRule get rules for all service

func (*Router) LoadRules

func (r *Router) LoadRules() error

LoadRules load all the router config

func (*Router) SetRouteRule

func (r *Router) SetRouteRule(rr map[string][]*config.RouteRule)

SetRouteRule set rules

func (*Router) SetRouteRuleByKey

func (r *Router) SetRouteRuleByKey(k string, rr []*config.RouteRule)

SetRouteRuleByKey set route rule by key

Jump to

Keyboard shortcuts

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