config

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 12

Documentation

Index

Constants

View Source
const (
	ConfFile       = "mesher.yaml"
	EgressConfFile = "egress.yaml"
)

Constant for mesher conf file

Variables

This section is empty.

Functions

func GetConfigContents

func GetConfigContents(key string) (string, error)

GetConfigContents returns config contents

func GetConfigFilePath

func GetConfigFilePath(key string) (string, error)

GetConfigFilePath returns config file path

func GetEgressEndpoints

func GetEgressEndpoints() string

GetEgressEndpoints returns the pilot address

func Init

func Init() error

Init reads config and initiates

func InitProtocols

func InitProtocols() error

InitProtocols initiates protocols

func SetConfig

func SetConfig(nc *MesherConfig)

SetConfig sets new mesher config from input config

func SetKeyValueByFile

func SetKeyValueByFile(key, f string) string

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 Admin

type Admin struct {
	Enable    bool   `yaml:"enable"`
	ServerURI string `yaml:"serverUri"`
}

Admin has attributes for enabling, serverURI and metrics for admin data

type Egress

type Egress struct {
	Infra   string `yaml:"infra"`
	Address string `yaml:"address"`
}

Egress define where rule comes from

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

func GetEgressConfig

func GetEgressConfig() *EgressConfig

GetEgressConfig returns Egress config

type EgressPort

type EgressPort struct {
	Port     int32  `yaml:"port"`
	Protocol string `yaml:"protocol"`
}

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 Ingress added in v1.7.0

type Ingress struct {
	Rule map[string]string `yaml:"rule"`
	Type string            `yaml:"type"`
}

Ingress hold rules and other settings

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 Match

type Match struct {
	Status string `yaml:"status"`
	Body   string `yaml:"body"`
}

Match define health check result success criteria

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

func GetConfig

func GetConfig() *MesherConfig

GetConfig returns mesher config

type PProf

type PProf struct {
	Enable bool   `yaml:"enable"`
	Listen string `yaml:"listen"`
}

PProf has enable and listen attribute for pprof

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 Port added in v1.7.0

type Port struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

Port is service port information

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

type Tracing added in v1.7.0

type Tracing struct {
	Enable    bool   `yaml:"enable"`
	ServerURI string `yaml:"serverUri"`
}

Tracing has attributes for APM

Jump to

Keyboard shortcuts

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