config

package
v0.0.0-...-a027a2a Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(filename string) ([]byte, error)

GetConfig returns a raw config file from embed templates

Types

type AlertManagerConfig

type AlertManagerConfig struct{}

AlertManagerConfig represent the data to generate AlertManager config

func NewAlertManagerConfig

func NewAlertManagerConfig() *AlertManagerConfig

NewAlertManagerConfig returns a AlertManagerConfig

func (*AlertManagerConfig) Config

func (c *AlertManagerConfig) Config() ([]byte, error)

Config generate the config file data.

func (*AlertManagerConfig) ConfigToFile

func (c *AlertManagerConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*AlertManagerConfig) ConfigWithTemplate

func (c *AlertManagerConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the AlertManager config content by tpl

type BlackboxConfig

type BlackboxConfig struct {
	DeployDir  string
	TLSEnabled bool
}

BlackboxConfig represent the data to generate AlertManager config

func NewBlackboxConfig

func NewBlackboxConfig(deployDir string, tlsEnabled bool) *BlackboxConfig

NewBlackboxConfig returns a BlackboxConfig

func (*BlackboxConfig) Config

func (c *BlackboxConfig) Config() ([]byte, error)

Config generate the config file data.

func (*BlackboxConfig) ConfigToFile

func (c *BlackboxConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*BlackboxConfig) ConfigWithTemplate

func (c *BlackboxConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the AlertManager config content by tpl

type DashboardConfig

type DashboardConfig struct {
	ClusterName string
	DeployDir   string
}

DashboardConfig represent the data to generate Dashboard config

func NewDashboardConfig

func NewDashboardConfig(cluster, deployDir string) *DashboardConfig

NewDashboardConfig returns a DashboardConfig

func (*DashboardConfig) Config

func (c *DashboardConfig) Config() ([]byte, error)

Config generate the config file data.

func (*DashboardConfig) ConfigToFile

func (c *DashboardConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*DashboardConfig) ConfigWithTemplate

func (c *DashboardConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the Dashboard config content by tpl

type DatasourceConfig

type DatasourceConfig struct {
	ClusterName string
	IP          string
	Port        uint64
}

DatasourceConfig represent the data to generate Datasource config

func NewDatasourceConfig

func NewDatasourceConfig(cluster, ip string) *DatasourceConfig

NewDatasourceConfig returns a DatasourceConfig

func (*DatasourceConfig) Config

func (c *DatasourceConfig) Config() ([]byte, error)

Config generate the config file data.

func (*DatasourceConfig) ConfigToFile

func (c *DatasourceConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*DatasourceConfig) ConfigWithTemplate

func (c *DatasourceConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the Datasource config content by tpl

func (*DatasourceConfig) WithPort

func (c *DatasourceConfig) WithPort(port uint64) *DatasourceConfig

WithPort set Port field of DatasourceConfig

type GrafanaConfig

type GrafanaConfig struct {
	DeployDir       string
	IP              string
	Port            uint64
	Username        string // admin_user
	Password        string // admin_password
	AnonymousEnable bool   // anonymous enable
	RootURL         string // root_url
	Domain          string // domain
}

GrafanaConfig represent the data to generate Grafana config

func NewGrafanaConfig

func NewGrafanaConfig(ip, deployDir string) *GrafanaConfig

NewGrafanaConfig returns a GrafanaConfig

func (*GrafanaConfig) Config

func (c *GrafanaConfig) Config() ([]byte, error)

Config generate the config file data.

func (*GrafanaConfig) ConfigToFile

func (c *GrafanaConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*GrafanaConfig) ConfigWithTemplate

func (c *GrafanaConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the Grafana config content by tpl

func (*GrafanaConfig) WithAnonymousenable

func (c *GrafanaConfig) WithAnonymousenable(anonymousEnable bool) *GrafanaConfig

WithAnonymousenable sets anonymousEnable of anonymousEnable

func (*GrafanaConfig) WithDomain

func (c *GrafanaConfig) WithDomain(domain string) *GrafanaConfig

WithDomain sets domain of server domain

func (*GrafanaConfig) WithPassword

func (c *GrafanaConfig) WithPassword(passwd string) *GrafanaConfig

WithPassword sets password of admin user

func (*GrafanaConfig) WithPort

func (c *GrafanaConfig) WithPort(port uint64) *GrafanaConfig

WithPort set Port field of GrafanaConfig

func (*GrafanaConfig) WithRootURL

func (c *GrafanaConfig) WithRootURL(rootURL string) *GrafanaConfig

WithRootURL sets rootURL of root url

func (*GrafanaConfig) WithUsername

func (c *GrafanaConfig) WithUsername(user string) *GrafanaConfig

WithUsername sets username of admin user

type PrometheusConfig

type PrometheusConfig struct {
	ClusterName               string
	TLSEnabled                bool
	KafkaAddrs                []string
	NodeExporterAddrs         []string
	TiDBStatusAddrs           []string
	TiKVStatusAddrs           []string
	PDAddrs                   []string
	TiFlashStatusAddrs        []string
	TiFlashLearnerStatusAddrs []string
	PumpAddrs                 []string
	DrainerAddrs              []string
	CDCAddrs                  []string
	ZookeeperAddrs            []string
	BlackboxExporterAddrs     []string
	LightningAddrs            []string
	MonitoredServers          []string
	AlertmanagerAddrs         []string
	PushgatewayAddr           string
	BlackboxAddr              string
	KafkaExporterAddr         string
	GrafanaAddr               string
	HasTiKVAccelerateRules    bool

	DMMasterAddrs []string
	DMWorkerAddrs []string

	LocalRules   []string
	RemoteConfig string
}

PrometheusConfig represent the data to generate Prometheus config

func NewPrometheusConfig

func NewPrometheusConfig(clusterName, clusterVersion string, enableTLS bool) *PrometheusConfig

NewPrometheusConfig returns a PrometheusConfig

func (*PrometheusConfig) AddAlertmanager

func (c *PrometheusConfig) AddAlertmanager(ip string, port uint64) *PrometheusConfig

AddAlertmanager add an alertmanager address

func (*PrometheusConfig) AddBlackbox

func (c *PrometheusConfig) AddBlackbox(ip string, port uint64) *PrometheusConfig

AddBlackbox add an blackbox address

func (*PrometheusConfig) AddBlackboxExporter

func (c *PrometheusConfig) AddBlackboxExporter(ip string, port uint64) *PrometheusConfig

AddBlackboxExporter add a BlackboxExporter address

func (*PrometheusConfig) AddCDC

func (c *PrometheusConfig) AddCDC(ip string, port uint64) *PrometheusConfig

AddCDC add a cdc address

func (*PrometheusConfig) AddDMMaster

func (c *PrometheusConfig) AddDMMaster(ip string, port uint64) *PrometheusConfig

AddDMMaster add an dm-master address

func (*PrometheusConfig) AddDMWorker

func (c *PrometheusConfig) AddDMWorker(ip string, port uint64) *PrometheusConfig

AddDMWorker add an dm-worker address

func (*PrometheusConfig) AddDrainer

func (c *PrometheusConfig) AddDrainer(ip string, port uint64) *PrometheusConfig

AddDrainer add a drainer address

func (*PrometheusConfig) AddGrafana

func (c *PrometheusConfig) AddGrafana(ip string, port uint64) *PrometheusConfig

AddGrafana add an kafka exporter address

func (*PrometheusConfig) AddKafka

func (c *PrometheusConfig) AddKafka(ip string, port uint64) *PrometheusConfig

AddKafka add a kafka address

func (*PrometheusConfig) AddKafkaExporter

func (c *PrometheusConfig) AddKafkaExporter(ip string, port uint64) *PrometheusConfig

AddKafkaExporter add an kafka exporter address

func (*PrometheusConfig) AddLightning

func (c *PrometheusConfig) AddLightning(ip string, port uint64) *PrometheusConfig

AddLightning add a lightning address

func (*PrometheusConfig) AddLocalRule

func (c *PrometheusConfig) AddLocalRule(rule string) *PrometheusConfig

AddLocalRule add a local rule

func (*PrometheusConfig) AddMonitoredServer

func (c *PrometheusConfig) AddMonitoredServer(ip string) *PrometheusConfig

AddMonitoredServer add a MonitoredServer address

func (*PrometheusConfig) AddNodeExpoertor

func (c *PrometheusConfig) AddNodeExpoertor(ip string, port uint64) *PrometheusConfig

AddNodeExpoertor add a node expoter address

func (*PrometheusConfig) AddPD

func (c *PrometheusConfig) AddPD(ip string, port uint64) *PrometheusConfig

AddPD add a PD address

func (*PrometheusConfig) AddPump

func (c *PrometheusConfig) AddPump(ip string, port uint64) *PrometheusConfig

AddPump add a pump address

func (*PrometheusConfig) AddPushgateway

func (c *PrometheusConfig) AddPushgateway(ip string, port uint64) *PrometheusConfig

AddPushgateway add an pushgateway address

func (*PrometheusConfig) AddTiDB

func (c *PrometheusConfig) AddTiDB(ip string, port uint64) *PrometheusConfig

AddTiDB add a TiDB address

func (*PrometheusConfig) AddTiFlash

func (c *PrometheusConfig) AddTiFlash(ip string, port uint64) *PrometheusConfig

AddTiFlash add a TiFlash address

func (*PrometheusConfig) AddTiFlashLearner

func (c *PrometheusConfig) AddTiFlashLearner(ip string, port uint64) *PrometheusConfig

AddTiFlashLearner add a TiFlash learner address

func (*PrometheusConfig) AddTiKV

func (c *PrometheusConfig) AddTiKV(ip string, port uint64) *PrometheusConfig

AddTiKV add a TiKV address

func (*PrometheusConfig) AddZooKeeper

func (c *PrometheusConfig) AddZooKeeper(ip string, port uint64) *PrometheusConfig

AddZooKeeper add a zookeeper address

func (*PrometheusConfig) Config

func (c *PrometheusConfig) Config() ([]byte, error)

Config generate the config file data.

func (*PrometheusConfig) ConfigToFile

func (c *PrometheusConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*PrometheusConfig) ConfigWithTemplate

func (c *PrometheusConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the Prometheus config content by tpl

func (*PrometheusConfig) SetRemoteConfig

func (c *PrometheusConfig) SetRemoteConfig(cfg string) *PrometheusConfig

SetRemoteConfig set remote read/write config

type TiSparkConfig

type TiSparkConfig struct {
	TiSparkMasters string
	CustomFields   map[string]interface{}
	Endpoints      []string
}

TiSparkConfig represent the data to generate TiSpark configs

func NewTiSparkConfig

func NewTiSparkConfig(pds []string) *TiSparkConfig

NewTiSparkConfig returns a TiSparkConfig

func (*TiSparkConfig) Config

func (c *TiSparkConfig) Config() ([]byte, error)

Config generate the config file data.

func (*TiSparkConfig) ConfigToFile

func (c *TiSparkConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*TiSparkConfig) ConfigWithTemplate

func (c *TiSparkConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate parses the template file

func (*TiSparkConfig) WithCustomFields

func (c *TiSparkConfig) WithCustomFields(m map[string]interface{}) *TiSparkConfig

WithCustomFields sets custom setting fields

func (*TiSparkConfig) WithMasters

func (c *TiSparkConfig) WithMasters(masters string) *TiSparkConfig

WithMasters sets master address

Jump to

Keyboard shortcuts

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