config

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 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 Admin

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

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 Match

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

Match define health check result success criteria

type MesherConfig

type MesherConfig struct {
	PProf       *PProf         `yaml:"pprof"`
	Plugin      *Plugin        `yaml:"plugin"`
	Admin       Admin          `yaml:"admin"`
	HealthCheck []*HealthCheck `yaml:"localHealthCheck"`
	ProxyedPro  string         `yaml:"proxyedProtocol"`
}

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

Jump to

Keyboard shortcuts

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