cse

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DarkLaunchPrefix   = "cse.darklaunch.policy."
	DarkLaunchTypeRule = "RULE"
	DarkLaunchTypeRate = "RATE"
)

constant for route rule keys

View Source
const RouteDarkLaunchGovernSourceName = "RouteDarkLaunchGovernSource"

RouteDarkLaunchGovernSourceName is source name of dark launch configuration

View Source
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 GetRouteRule

func GetRouteRule() map[string][]*model.RouteRule

GetRouteRule get route rule

func GetRouteRuleByKey

func GetRouteRuleByKey(k string) []*model.RouteRule

GetRouteRuleByKey get route rule by key

func SetRouteRule

func SetRouteRule(rule map[string][]*model.RouteRule)

SetRouteRule set route rule

func SetRouteRuleByKey

func SetRouteRuleByKey(k string, r []*model.RouteRule)

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

func (r *Router) FetchRouteRule() map[string][]*model.RouteRule

FetchRouteRule return all rules

func (*Router) FetchRouteRuleByServiceName

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

FetchRouteRuleByServiceName get rules for service

func (*Router) Init

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

Init init router config

func (*Router) InitRouteRuleByKey added in v0.7.1

func (r *Router) InitRouteRuleByKey(k string)

InitRouteRuleByKey init route rule by service key

func (*Router) SetRouteRule

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

SetRouteRule set rules

Jump to

Keyboard shortcuts

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