Documentation ¶
Index ¶
- Constants
- type Accesslog
- type AddressMatch
- type Argument
- type Base
- type ClusterMetricsRes
- type ConditionMatch
- type ConditionRoute
- type ConditionRouteDto
- type Consumer
- type DynamicConfig
- type Entity
- type FlowMetricsRes
- type Gray
- type HTTPError
- type Host
- type ListMockRulesByPage
- type ListServiceByPage
- type ListStringMatch
- type Metadata
- type Mock
- type MockRule
- type MockRuleEntity
- type OldOverride
- type Override
- type OverrideConfig
- type ParamMatch
- type Percentage
- type Provider
- type Region
- type RegistrySource
- type ResponseAny
- type Retry
- type ServiceDTO
- type ServiceDetailDTO
- type StringMatch
- type Tag
- type TagRoute
- type TagRouteDto
- type Target
- type Timeout
- type Weight
Constants ¶
View Source
const ( All RegistrySource = "ALL" Interface = "INTERFACE" Instance = "INSTANCE" )
View Source
const ArgumentAdminIdentifier string = " & arg_admin_rule!=false"
View Source
const RegionAdminIdentifier string = " & region_admin_rule!=false"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accesslog ¶
type AddressMatch ¶
type AddressMatch struct { Wildcard string `json:"wildcard" yaml:"wildcard,omitempty"` Cird string `json:"cird" yaml:"cird,omitempty"` Exact string `json:"exact" yaml:"exact,omitempty"` }
func (*AddressMatch) IsMatch ¶
func (m *AddressMatch) IsMatch(input string) bool
type Argument ¶
type Argument struct { Service string `json:"service" binding:"required"` Group string `json:"group"` Version string `json:"version"` Rule string `json:"rule" binding:"required"` }
func (Argument) ToRule ¶
func (r Argument) ToRule() ConditionRoute
type ClusterMetricsRes ¶
type ConditionMatch ¶
type ConditionMatch struct { Address AddressMatch `json:"address" yaml:"address,omitempty"` Service ListStringMatch `json:"service" yaml:"service,omitempty"` Application ListStringMatch `json:"application" yaml:"application,omitempty"` Param []ParamMatch `json:"param" yaml:"param,omitempty"` }
type ConditionRoute ¶
type ConditionRoute struct { Priority int `json:"priority" yaml:"priority,omitempty"` Enabled bool `json:"enabled" yaml:"enabled"` Force bool `json:"force" yaml:"force"` Runtime bool `json:"runtime" yaml:"runtime,omitempty"` Key string `json:"key" yaml:"key"` Scope string `json:"scope" yaml:"scope"` Conditions []string `json:"conditions" yaml:"conditions"` ConfigVersion string `json:"configVersion" yaml:"configVersion"` }
type ConditionRouteDto ¶
type ConditionRouteDto struct { Base Conditions []string `json:"conditions" yaml:"conditions" binding:"required"` Priority int `json:"priority" yaml:"priority"` Enabled bool `json:"enabled" yaml:"enabled" binding:"required"` Force bool `json:"force" yaml:"force"` Runtime bool `json:"runtime" yaml:"runtime"` ConfigVersion string `json:"configVersion" yaml:"configVersion" binding:"required"` }
type Consumer ¶
type Consumer struct { Entity Service string `json:"service"` Parameters string `json:"parameters"` Result string `json:"result"` Address string `json:"address"` Registry string `json:"registry"` Application string `json:"application"` Username string `json:"username"` Statistics string `json:"statistics"` Collected time.Duration `json:"collected"` Expired time.Duration `json:"expired"` Alived int64 `json:"alived"` }
type DynamicConfig ¶
type DynamicConfig struct { Base ConfigVersion string `json:"configVersion"` Enabled bool `json:"enabled"` Configs []OverrideConfig `json:"configs"` }
func (*DynamicConfig) ToOldOverride ¶
func (d *DynamicConfig) ToOldOverride() []*OldOverride
func (*DynamicConfig) ToOverride ¶
func (d *DynamicConfig) ToOverride() *Override
type Entity ¶
type Entity struct { Id int64 `json:"id"` Ids []int64 `json:"ids"` Hash string `json:"hash"` Created time.Time `json:"created"` Modified time.Time `json:"modified"` Now time.Time `json:"now"` Operator string `json:"operator"` OperatorAddress string `json:"operatorAddress"` Miss bool `json:"miss"` }
func (*Entity) SetOperator ¶
type FlowMetricsRes ¶
type Gray ¶
type ListMockRulesByPage ¶
type ListServiceByPage ¶
type ListStringMatch ¶
type ListStringMatch struct {
Oneof []StringMatch `json:"oneof" yaml:"oneof,omitempty"`
}
func (*ListStringMatch) IsMatch ¶
func (l *ListStringMatch) IsMatch(input string) bool
type Mock ¶
type MockRule ¶
type MockRule struct { ID uint `json:"id"` ServiceName string `json:"serviceName"` MethodName string `json:"methodName"` Rule string `json:"rule"` Enable bool `json:"enable"` }
func (*MockRule) ToMockRuleEntity ¶
func (m *MockRule) ToMockRuleEntity() *MockRuleEntity
type MockRuleEntity ¶
type MockRuleEntity struct { gorm.Model ServiceName string `gorm:"type:varchar(255)"` MethodName string `gorm:"type:varchar(255)"` Rule string `gorm:"type:text"` Enable bool }
func (*MockRuleEntity) TableName ¶
func (m *MockRuleEntity) TableName() string
func (*MockRuleEntity) ToMockRule ¶
func (m *MockRuleEntity) ToMockRule() *MockRule
type OldOverride ¶
type OldOverride struct { Entity Service string Address string Enabled bool Application string Params string }
func (*OldOverride) SetParamsByOverrideConfig ¶
func (o *OldOverride) SetParamsByOverrideConfig(config OverrideConfig)
type Override ¶
type Override struct { Key string `json:"key" yaml:"key"` Scope string `json:"scope" yaml:"scope"` ConfigVersion string `json:"configVersion" yaml:"configVersion"` Enabled bool `json:"enabled" yaml:"enabled"` Configs []OverrideConfig `json:"configs" yaml:"configs"` }
func (*Override) ToDynamicConfig ¶
func (o *Override) ToDynamicConfig() *DynamicConfig
type OverrideConfig ¶
type OverrideConfig struct { Side string `json:"side" yaml:"side"` Addresses []string `json:"addresses" yaml:"addresses,omitempty"` ProviderAddresses []string `json:"providerAddresses" yaml:"providerAddresses,omitempty"` Parameters map[string]interface{} `json:"parameters" yaml:"parameters"` Applications []string `json:"applications" yaml:"applications,omitempty"` Services []string `json:"services" yaml:"services,omitempty"` Type string `json:"type" yaml:"type,omitempty"` Enabled bool `json:"enabled" yaml:"enabled,omitempty"` Match ConditionMatch `json:"match" yaml:"match,omitempty"` }
type ParamMatch ¶
type ParamMatch struct { Key string `json:"key" yaml:"key"` Value StringMatch `json:"value" yaml:"value"` }
type Percentage ¶
type Percentage struct { Service string `json:"service" binding:"required"` Group string `json:"group"` Version string `json:"version"` Weights []Weight `json:"weights" binding:"required"` }
func (Percentage) ToRule ¶
func (p Percentage) ToRule() Override
type Provider ¶
type Provider struct { Entity Service string `json:"service"` URL string `json:"url"` Parameters string `json:"parameters"` Address string `json:"address"` Registry string `json:"registry"` Dynamic bool `json:"dynamic"` Enabled bool `json:"enabled"` Timeout int64 `json:"timeout"` Serialization string `json:"serialization"` Weight int64 `json:"weight"` Application string `json:"application"` Username string `json:"username"` Expired time.Duration `json:"expired"` Alived int64 `json:"alived"` RegistrySource RegistrySource `json:"registrySource"` }
type Region ¶
type Region struct { Service string `json:"service" binding:"required"` Group string `json:"group"` Version string `json:"version"` Rule string `json:"rule"` }
func (Region) ToRule ¶
func (r Region) ToRule() ConditionRoute
type RegistrySource ¶
type RegistrySource string
type ResponseAny ¶
type Retry ¶
type ServiceDTO ¶
type ServiceDTO struct { Service string `json:"service"` AppName string `json:"appName"` Group string `json:"group"` Version string `json:"version"` RegistrySource RegistrySource `json:"registrySource"` }
ServiceDTO is the transforming format of service
type ServiceDetailDTO ¶
type StringMatch ¶
type StringMatch struct { Exact string `json:"exact" yaml:"exact,omitempty"` Prefix string `json:"prefix" yaml:"prefix,omitempty"` Regex string `json:"regex" yaml:"regex,omitempty"` Noempty string `json:"noempty" yaml:"noempty,omitempty"` Empty string `json:"empty" yaml:"empty,omitempty"` Wildcard string `json:"wildcard" yaml:"wildcard,omitempty"` }
func (*StringMatch) IsMatch ¶
func (m *StringMatch) IsMatch(input string) bool
type Tag ¶
type Tag struct { Name string `json:"name" yaml:"name" binding:"required"` Match []ParamMatch `json:"match" yaml:"match" binding:"required,omitempty"` Addresses []string `json:"addresses" yaml:"addresses,omitempty"` }
type TagRoute ¶
type TagRoute struct { Priority int `json:"priority" yaml:"priority,omitempty"` Enabled bool `json:"enabled" yaml:"enabled"` Force bool `json:"force" yaml:"force"` Runtime bool `json:"runtime" yaml:"runtime,omitempty"` Key string `json:"key" yaml:"key"` Tags []Tag `json:"tags" yaml:"tags"` ConfigVersion string `json:"configVersion" yaml:"configVersion"` }
type TagRouteDto ¶
type TagRouteDto struct { Base Tags []Tag `json:"tags" yaml:"tags" binding:"required"` Priority int `json:"priority" yaml:"priority,omitempty"` Enabled bool `json:"enabled" yaml:"enabled" binding:"required"` Force bool `json:"force" yaml:"force"` Runtime bool `json:"runtime" yaml:"runtime,omitempty"` ConfigVersion string `json:"configVersion" yaml:"configVersion" binding:"required"` }
type Timeout ¶
type Weight ¶
type Weight struct { Weight int `json:"weight" binding:"required"` Match ConditionMatch `json:"match" binding:"required"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.