Documentation ¶
Index ¶
- Constants
- func GetConfigContents(key string) (string, error)
- func GetConfigFilePath(key string) (string, error)
- func GetEgressEndpoints() string
- func Init() error
- func InitProtocols() error
- func SetConfig(nc *MesherConfig)
- func SetKeyValueByFile(key, f string) string
- type APM
- type Admin
- type Egress
- type EgressConfig
- type EgressPort
- type EgressRule
- type HealthCheck
- type Ingress
- type IngressRule
- type IngressRules
- type Match
- type Mesher
- type MesherConfig
- type PProf
- type Plugin
- type Policy
- type Port
- type Service
- type ServiceComb
- type Tracing
Constants ¶
const ( ConfFile = "mesher.yaml" EgressConfFile = "egress.yaml" )
Constant for mesher conf file
Variables ¶
This section is empty.
Functions ¶
func GetConfigContents ¶
GetConfigContents returns config contents
func GetConfigFilePath ¶
GetConfigFilePath returns config file path
func GetEgressEndpoints ¶
func GetEgressEndpoints() string
GetEgressEndpoints returns the pilot address
func SetConfig ¶
func SetConfig(nc *MesherConfig)
SetConfig sets new mesher config from input config
func SetKeyValueByFile ¶
SetKeyValueByFile reads mesher.yaml and gets key and value
Types ¶
type APM ¶ added in v1.7.0
type APM struct {
Tracing Tracing `yaml:"tracing"`
}
APM is for Application Performance Management
type EgressConfig ¶
type EgressConfig struct { Egress Egress `yaml:"egress"` Destinations map[string][]*EgressRule `yaml:"egressRule"` }
EgressConfig is the struct having info about egress rule destinations
type EgressPort ¶
EgressPort protocol and the corresponding port
type EgressRule ¶
type EgressRule struct { Hosts []string `yaml:"hosts"` Ports []*EgressPort `yaml:"ports"` }
EgressRule has hosts and ports information
type HealthCheck ¶
type HealthCheck struct { Port string `yaml:"port"` Protocol string `yaml:"protocol"` URI string `yaml:"uri"` Interval string `yaml:"interval"` Match *Match `yaml:"match"` }
HealthCheck define how to check local ports
type IngressRule ¶ added in v1.7.0
type IngressRule struct { Host string `yaml:"host"` Limit int `yaml:"limit"` APIPath string `yaml:"apiPath"` Service Service `yaml:"service"` }
IngressRule is a ingress rule
type IngressRules ¶ added in v1.7.0
type IngressRules []*IngressRule
IngressRules is ingress rules slice
func NewRules ¶ added in v1.7.0
func NewRules(raw string) (*IngressRules, error)
NewRules create a rule by raw data
func (IngressRules) Len ¶ added in v1.7.0
func (r IngressRules) Len() int
Len return the length of rule
func (IngressRules) Value ¶ added in v1.7.0
func (r IngressRules) Value() []*IngressRule
Value return the rule
type Mesher ¶ added in v1.7.0
type Mesher struct {
Ingress Ingress `yaml:"ingress"`
}
Mesher is prefix
type MesherConfig ¶
type MesherConfig struct { Mesher Mesher `yaml:"mesher"` PProf *PProf `yaml:"pprof"` Plugin *Plugin `yaml:"plugin"` Admin Admin `yaml:"admin"` HealthCheck []*HealthCheck `yaml:"localHealthCheck"` ProxyedPro string `yaml:"proxyedProtocol"` ServiceComb *ServiceComb `yaml:"servicecomb"` }
MesherConfig has all mesher config
type Plugin ¶
type Plugin struct { DestinationResolver map[string]string `yaml:"destinationResolver"` SourceResolver string `yaml:"sourceResolver"` }
Plugin has attributes for destination and source resolver
type Policy ¶
type Policy struct { Destination string `yaml:"destination"` Tags map[string]string `yaml:"tags"` LoadBalancing map[string]string `yaml:"loadBalancing"` }
Policy has attributes for destination, tags and loadbalance
type Service ¶ added in v1.7.0
type Service struct { Name string `yaml:"name"` Tags map[string]string `yaml:"tags"` RedirectPath string `yaml:"redirectPath"` Port Port `yaml:"port"` }
Service is upstream info
type ServiceComb ¶ added in v1.7.0
type ServiceComb struct {
APM APM `yaml:"apm"`
}
ServiceComb is for servicecomb config