template

package
v0.0.0-...-95388de Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HealthStatusOK healthy flag
	HealthStatusOK = true
	// HealthStatusOKMsg messsage when healthy
	HealthStatusOKMsg = "I am OK"
	// HealthStatusNotOK unhealthy flag
	HealthStatusNotOK = false

	// LoadbalanceConfigRenderTotal times of rendering loadbalance config
	LoadbalanceConfigRenderTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "loadbalance",
			Subsystem: "template",
			Name:      "config_render_total",
			Help:      "times of rendering loadbalance config",
		}, []string{"result"},
	)
	// LoadbalanceConfigRefreshTotal times of refreshing loadbalance config
	LoadbalanceConfigRefreshTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "loadbalance",
			Subsystem: "template",
			Name:      "config_refresh_total",
			Help:      "times of refreshing loadbalance config",
		}, []string{"result"},
	)
	// LoadbalanceProxyReloadTotal times of reloading loadbalance config
	LoadbalanceProxyReloadTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "loadbalance",
			Subsystem: "template",
			Name:      "proxy_reload_total",
			Help:      "times of reloading proxy process",
		}, []string{"result"},
	)
)

Functions

func IsFileExist

func IsFileExist(filename string) bool

IsFileExist check file exist

Types

type Manager

type Manager interface {
	//Start point, do not block
	Start() error
	//Stop
	Stop()
	//Create config file with tmpData,
	Create(tmpData *types.TemplateData) (string, error)
	//CheckDifference two file are difference, true is difference
	CheckDifference(oldFile, curFile string) bool
	//Validate new cfg file grammar is OK
	Validate(newFile string) bool
	//Replace old cfg file with cur one, return old file backup
	Replace(oldFile, curFile string) error
	//Reload haproxy with new config file
	Reload(cfgFile string) error
	TryUpdateWithoutReload(tmpData *types.TemplateData) bool
	//GetHealthInfo response healthz info
	// GetHealthInfo() metric.HealthMeta
	// //Get metric meta
	// GetMetricMeta() *metric.MetricMeta
	// //Get metric result
	// GetMetricResult() (*metric.MetricResult, error)
	// GetStatusFunction get status function
	GetStatusFunction() restful.RouteFunction
	// Describe implements prometheus collector interface
	Describe(ch chan<- *prometheus.Desc)
	// Collect implements prometheus collector interface
	Collect(ch chan<- prometheus.Metric)
}

Manager define interface for manager

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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