config

package
v0.0.0-...-4d3f714 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

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

Constant for mesher conf file

Variables

View Source
var Mode string

Mode is of type string which gives mode of mesher deployment

Functions

func GetConfigContents

func GetConfigContents(key string) (string, error)

GetConfigContents returns config contents

func GetConfigFilePath

func GetConfigFilePath() (string, error)

GetConfigFilePath returns config file path

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 HealthCheck

type HealthCheck struct {
	PortName string `yaml:"portName"`
	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 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