Documentation ¶
Index ¶
- Constants
- func AddRouteRuleSource(s core.ConfigSource) error
- func DarkLaunchRule2RouteRule(rule *model.DarkLaunchRule) []*model.RouteRule
- func DeleteRouteRuleByKey(k string)
- func GetRouteRule() map[string][]*model.RouteRule
- func GetRouteRuleByKey(k string) []*model.RouteRule
- func SetRouteRule(rule map[string][]*model.RouteRule)
- func SetRouteRuleByKey(k string, r []*model.RouteRule)
- type RouteDarkLaunchGovernSource
- func (r *RouteDarkLaunchGovernSource) AddDimensionInfo(dimensionInfo string) (map[string]string, error)
- func (r *RouteDarkLaunchGovernSource) Callback(e *core.Event)
- func (r *RouteDarkLaunchGovernSource) Cleanup() error
- func (r *RouteDarkLaunchGovernSource) DynamicConfigHandler(d core.DynamicConfigCallback) error
- func (r *RouteDarkLaunchGovernSource) GetConfigurationByKey(k string) (interface{}, error)
- func (r *RouteDarkLaunchGovernSource) GetConfigurationByKeyAndDimensionInfo(key, dimensionInfo string) (interface{}, error)
- func (r *RouteDarkLaunchGovernSource) GetConfigurations() (map[string]interface{}, error)
- func (r *RouteDarkLaunchGovernSource) GetConfigurationsByDI(dimensionInfo string) (map[string]interface{}, error)
- func (r *RouteDarkLaunchGovernSource) GetPriority() int
- func (r *RouteDarkLaunchGovernSource) GetSourceName() string
- type Router
Constants ¶
const ( DarkLaunchPrefix = "cse.darklaunch.policy." DarkLaunchTypeRule = "RULE" DarkLaunchTypeRate = "RATE" )
constant for route rule keys
const RouteDarkLaunchGovernSourceName = "RouteDarkLaunchGovernSource"
RouteDarkLaunchGovernSourceName is source name of dark launch configuration
const RouteDarkLaunchGovernSourcePriority = 8
RouteDarkLaunchGovernSourcePriority is priority of dark launch configuration
Variables ¶
This section is empty.
Functions ¶
func AddRouteRuleSource ¶
func AddRouteRuleSource(s core.ConfigSource) error
AddRouteRuleSource adds a config source to route rule manager Do not call this method until router init success
func DarkLaunchRule2RouteRule ¶
func DarkLaunchRule2RouteRule(rule *model.DarkLaunchRule) []*model.RouteRule
DarkLaunchRule2RouteRule translates dark launch rule to route rule
func DeleteRouteRuleByKey ¶
func DeleteRouteRuleByKey(k string)
DeleteRouteRuleByKey set route rule by key
func GetRouteRuleByKey ¶
GetRouteRuleByKey get route rule by key
func SetRouteRule ¶
SetRouteRule set route rule
func SetRouteRuleByKey ¶
SetRouteRuleByKey set route rule by key
Types ¶
type RouteDarkLaunchGovernSource ¶
type RouteDarkLaunchGovernSource struct {
// contains filtered or unexported fields
}
RouteDarkLaunchGovernSource gets dark launch configs from global archaius, it cannot work until global archaius inits success, it keeps no data
func NewRouteDarkLaunchGovernSource ¶
func NewRouteDarkLaunchGovernSource() *RouteDarkLaunchGovernSource
NewRouteDarkLaunchGovernSource returns default RouteDarkLaunchGovernSource
func (*RouteDarkLaunchGovernSource) AddDimensionInfo ¶
func (r *RouteDarkLaunchGovernSource) AddDimensionInfo(dimensionInfo string) (map[string]string, error)
AddDimensionInfo implements ConfigSource.AddDimensionInfo
func (*RouteDarkLaunchGovernSource) Callback ¶
func (r *RouteDarkLaunchGovernSource) Callback(e *core.Event)
Callback callbacks when receive an event only operates after dynamicCallback is initialized
func (*RouteDarkLaunchGovernSource) Cleanup ¶
func (r *RouteDarkLaunchGovernSource) Cleanup() error
Cleanup implements ConfigSource.Cleanup
func (*RouteDarkLaunchGovernSource) DynamicConfigHandler ¶
func (r *RouteDarkLaunchGovernSource) DynamicConfigHandler(d core.DynamicConfigCallback) error
DynamicConfigHandler dynamically handles a dark launch configuration
func (*RouteDarkLaunchGovernSource) GetConfigurationByKey ¶
func (r *RouteDarkLaunchGovernSource) GetConfigurationByKey(k string) (interface{}, error)
GetConfigurationByKey gets required dark launch configuration for a particular key
func (*RouteDarkLaunchGovernSource) GetConfigurationByKeyAndDimensionInfo ¶
func (r *RouteDarkLaunchGovernSource) GetConfigurationByKeyAndDimensionInfo(key, dimensionInfo string) (interface{}, error)
GetConfigurationByKeyAndDimensionInfo implements ConfigSource.GetConfigurationByKeyAndDimensionInfo
func (*RouteDarkLaunchGovernSource) GetConfigurations ¶
func (r *RouteDarkLaunchGovernSource) GetConfigurations() (map[string]interface{}, error)
GetConfigurations gets all dark launch configurations
func (*RouteDarkLaunchGovernSource) GetConfigurationsByDI ¶
func (r *RouteDarkLaunchGovernSource) GetConfigurationsByDI(dimensionInfo string) (map[string]interface{}, error)
GetConfigurationsByDI implements ConfigSource.GetConfigurationsByDI
func (*RouteDarkLaunchGovernSource) GetPriority ¶
func (r *RouteDarkLaunchGovernSource) GetPriority() int
GetPriority returns priority of the dark launch configuration
func (*RouteDarkLaunchGovernSource) GetSourceName ¶
func (r *RouteDarkLaunchGovernSource) GetSourceName() string
GetSourceName returns name of dark launch configuration
type Router ¶
type Router struct { }
Router is cse router service
func (*Router) FetchRouteRule ¶
FetchRouteRule return all rules
func (*Router) FetchRouteRuleByServiceName ¶
FetchRouteRuleByServiceName get rules for service
func (*Router) InitRouteRuleByKey ¶ added in v0.7.1
InitRouteRuleByKey init route rule by service key