Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: May 20, 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 added in v1.0.9

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
	DefaultTheme    string // default_theme
	OrgName         string // org_name
	OrgRole         string // org_role
}

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 added in v1.4.0

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

WithAnonymousenable sets anonymousEnable of anonymousEnable

func (*GrafanaConfig) WithDefaultTheme added in v1.6.0

func (c *GrafanaConfig) WithDefaultTheme(defaultTheme string) *GrafanaConfig

WithDefaultTheme sets defaultTheme of default theme

func (*GrafanaConfig) WithDomain added in v1.4.0

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

WithDomain sets domain of server domain

func (*GrafanaConfig) WithOrgName added in v1.6.0

func (c *GrafanaConfig) WithOrgName(orgName string) *GrafanaConfig

WithOrgName sets orgName of org name

func (*GrafanaConfig) WithOrgRole added in v1.6.0

func (c *GrafanaConfig) WithOrgRole(orgRole string) *GrafanaConfig

WithOrgRole sets orgName of org role

func (*GrafanaConfig) WithPassword added in v1.3.0

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 added in v1.4.0

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

WithRootURL sets rootURL of root url

func (*GrafanaConfig) WithUsername added in v1.3.0

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

WithUsername sets username of admin user

type NgMonitoringConfig added in v1.7.0

type NgMonitoringConfig struct {
	ClusterName string
	TLSEnabled  bool
	IP          string
	Port        int
	PDAddrs     string
	DeployDir   string
	DataDir     string
	LogDir      string
}

NgMonitoringConfig represent the data to generate NgMonitoring config

func NewNgMonitoringConfig added in v1.7.0

func NewNgMonitoringConfig(clusterName, clusterVersion string, enableTLS bool) *NgMonitoringConfig

NewNgMonitoringConfig returns a PrometheusConfig

func (*NgMonitoringConfig) AddDataDir added in v1.7.0

func (c *NgMonitoringConfig) AddDataDir(dir string) *NgMonitoringConfig

AddDataDir add logdir to ng-monitoring conf

func (*NgMonitoringConfig) AddDeployDir added in v1.7.0

func (c *NgMonitoringConfig) AddDeployDir(dir string) *NgMonitoringConfig

AddDeployDir add logdir to ng-monitoring conf

func (*NgMonitoringConfig) AddIP added in v1.7.0

AddIP add ip to ng-monitoring conf

func (*NgMonitoringConfig) AddLog added in v1.7.0

AddLog add logdir to ng-monitoring conf

func (*NgMonitoringConfig) AddPD added in v1.7.0

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

AddPD add a PD address

func (*NgMonitoringConfig) AddPort added in v1.7.0

func (c *NgMonitoringConfig) AddPort(port int) *NgMonitoringConfig

AddPort add port to ng-monitoring conf

func (*NgMonitoringConfig) Config added in v1.7.0

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

Config generate the config file data.

func (*NgMonitoringConfig) ConfigToFile added in v1.7.0

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

ConfigToFile write config content to specific path

func (*NgMonitoringConfig) ConfigWithTemplate added in v1.7.0

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

ConfigWithTemplate generate the Prometheus config content by tpl

type PrometheusConfig

type PrometheusConfig struct {
	ClusterName               string
	TLSEnabled                bool
	NodeExporterAddrs         []string
	TiDBStatusAddrs           []string
	TiKVStatusAddrs           []string
	PDAddrs                   []string
	TiFlashStatusAddrs        []string
	TiFlashLearnerStatusAddrs []string
	PumpAddrs                 []string
	DrainerAddrs              []string
	CDCAddrs                  []string
	BlackboxExporterAddrs     []string
	LightningAddrs            []string
	MonitoredServers          []string
	AlertmanagerAddrs         []string
	NGMonitoringAddrs         []string
	PushgatewayAddr           string
	BlackboxAddr              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 added in v1.3.0

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

AddDMMaster add an dm-master address

func (*PrometheusConfig) AddDMWorker added in v1.3.0

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 Grafana address

func (*PrometheusConfig) AddLightning

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

AddLightning add a lightning address

func (*PrometheusConfig) AddLocalRule added in v1.4.0

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) AddNGMonitoring added in v1.9.3

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

AddNGMonitoring add an ng-monitoring server exporter 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) 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 added in v1.4.0

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

SetRemoteConfig set remote read/write config

type TiSparkConfig added in v1.0.9

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

TiSparkConfig represent the data to generate TiSpark configs

func NewTiSparkConfig added in v1.0.9

func NewTiSparkConfig(pds []string) *TiSparkConfig

NewTiSparkConfig returns a TiSparkConfig

func (*TiSparkConfig) Config added in v1.0.9

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

Config generate the config file data.

func (*TiSparkConfig) ConfigToFile added in v1.0.9

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

ConfigToFile write config content to specific path

func (*TiSparkConfig) ConfigWithTemplate added in v1.0.9

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

ConfigWithTemplate parses the template file

func (*TiSparkConfig) WithCustomFields added in v1.0.9

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

WithCustomFields sets custom setting fields

func (*TiSparkConfig) WithMasters added in v1.0.9

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