routers

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DestConfigPath = "/etc/prometheus/prometheus.yml"

Functions

func CheckEnvs

func CheckEnvs(envs []string) error

func GenerateConfigHandler

func GenerateConfigHandler(w http.ResponseWriter, r *http.Request)

func StartContainer

func StartContainer(s *Service) error

func StartRoute

func StartRoute(w http.ResponseWriter, r *http.Request)

func StopContainer

func StopContainer(containerName string)

func StopRoute

func StopRoute(w http.ResponseWriter, r *http.Request)

Types

type BasicAuth

type BasicAuth struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type Config

type Config struct {
	Services []Service `yaml:"services"`
}

func (*Config) LoadConfig

func (cfg *Config) LoadConfig(configName string) error

func (*Config) SearchByName

func (cfg *Config) SearchByName(name string) *Service

type Jobs

type Jobs struct {
	Jobs     []JsonData `json:"jobs"`
	Password string     `json:"password"`
	Target   string     `json:"target"`
	Interval string     `json:"interval"`
	Timeout  string     `json:"timeout"`
}

func (*Jobs) ConvertToYml

func (j *Jobs) ConvertToYml() error

type JsonData

type JsonData struct {
	Name     string `json:"name"`
	Path     string `json:"path"`
	Interval string `json:"interval"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Global struct {
		ScrapeInterval     string `yaml:"scrape_interval"`
		ScrapeTimeout      string `yaml:"scrape_timeout"`
		EvaluationInterval string `yaml:"evaluation_interval"`
	} `yaml:"global"`
	ScrapeConfigs []ScrapeConfigs `yaml:"scrape_configs"`
}

func (*PrometheusConfig) GenerateConfig

func (p *PrometheusConfig) GenerateConfig(filepath string) error

type ScrapeConfigs

type ScrapeConfigs struct {
	JobName        string          `yaml:"job_name"`
	MetricsPath    string          `yaml:"metrics_path,omitempty"`
	ScrapeInterval string          `yaml:"scrape_interval,omitempty"`
	ScrapeTimeout  string          `yaml:"scrape_timeout,omitempty"`
	StaticConfigs  []StaticConfigs `yaml:"static_configs"`
	BasicAuth      BasicAuth       `yaml:"basic_auth,omitempty"`
}

type Service

type Service struct {
	Name    string   `yaml:"name"`
	Image   string   `yaml:"image"`
	Ports   []string `yaml:"ports"`
	Volumes []string `yaml:"volumes"`
}

type StaticConfigs

type StaticConfigs struct {
	Targets []string `yaml:"targets"`
}

Jump to

Keyboard shortcuts

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