Documentation ¶
Index ¶
- Constants
- func ConvertJSON2RouteRule(raw string) ([]*config.RouteRule, error)
- func DarkLaunchRule2RouteRule(rule *config.DarkLaunchRule) []*config.RouteRule
- func MergeLocalAndRemoteConfig() (map[string][]*config.RouteRule, error)
- func SaveRouteRule(service string, raw string, isV2 bool)
- type Router
- func (r *Router) DeleteRouteRuleByKey(k string)
- func (r *Router) FetchRouteRuleByServiceName(service string) []*config.RouteRule
- func (r *Router) Init(o router.Options) error
- func (r *Router) ListRouteRule() map[string][]*config.RouteRule
- func (r *Router) LoadRules() error
- func (r *Router) SetRouteRule(rr map[string][]*config.RouteRule)
- func (r *Router) SetRouteRuleByKey(k string, rr []*config.RouteRule)
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 ¶
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 ¶
MergeLocalAndRemoteConfig get router config from archaius, including local file,memory and config server
func SaveRouteRule ¶
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 ¶
DeleteRouteRuleByKey set route rule by key
func (*Router) FetchRouteRuleByServiceName ¶
FetchRouteRuleByServiceName get rules for service
func (*Router) ListRouteRule ¶
ListRouteRule get rules for all service
func (*Router) SetRouteRule ¶
SetRouteRule set rules
Click to show internal directories.
Click to hide internal directories.