scripts

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetScript

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

GetScript returns a raw config file from embed templates

Types

type AlertManagerScript

type AlertManagerScript struct {
	IP          string
	WebPort     int
	ClusterPort int
	DeployDir   string
	DataDir     string
	LogDir      string
	NumaNode    string
	TLSEnabled  bool
	EndPoints   []*AlertManagerScript
}

AlertManagerScript represent the data to generate AlertManager start script

func NewAlertManagerScript

func NewAlertManagerScript(ip, deployDir, dataDir, logDir string, enableTLS bool) *AlertManagerScript

NewAlertManagerScript returns a AlertManagerScript with given arguments

func (*AlertManagerScript) AppendEndpoints

func (c *AlertManagerScript) AppendEndpoints(ends []*AlertManagerScript) *AlertManagerScript

AppendEndpoints add new alert manager to Endpoints field

func (*AlertManagerScript) Config

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

Config generate the config file data.

func (*AlertManagerScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*AlertManagerScript) ConfigWithTemplate

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

ConfigWithTemplate generate the AlertManager config content by tpl

func (*AlertManagerScript) WithClusterPort

func (c *AlertManagerScript) WithClusterPort(port int) *AlertManagerScript

WithClusterPort set WebPort field of AlertManagerScript

func (*AlertManagerScript) WithNumaNode

func (c *AlertManagerScript) WithNumaNode(numa string) *AlertManagerScript

WithNumaNode set NumaNode field of AlertManagerScript

func (*AlertManagerScript) WithWebPort

func (c *AlertManagerScript) WithWebPort(port int) *AlertManagerScript

WithWebPort set WebPort field of AlertManagerScript

type BlackboxExporterScript

type BlackboxExporterScript struct {
	Port      uint64
	DeployDir string
	LogDir    string
	NumaNode  string
}

BlackboxExporterScript represent the data to generate BlackboxExporter config

func NewBlackboxExporterScript

func NewBlackboxExporterScript(deployDir, logDir string) *BlackboxExporterScript

NewBlackboxExporterScript returns a BlackboxExporterScript with given arguments

func (*BlackboxExporterScript) Config

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

Config generate the config file data.

func (*BlackboxExporterScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*BlackboxExporterScript) ConfigWithTemplate

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

ConfigWithTemplate generate the BlackboxExporter config content by tpl

func (*BlackboxExporterScript) WithNumaNode

func (c *BlackboxExporterScript) WithNumaNode(numa string) *BlackboxExporterScript

WithNumaNode set NumaNode field of BlackboxExporterScript

func (*BlackboxExporterScript) WithPort

WithPort set WebPort field of BlackboxExporterScript

type CDCScript

type CDCScript struct {
	IP                string
	Port              int
	DeployDir         string
	LogDir            string
	DataDir           string
	NumaNode          string
	GCTTL             int64
	TZ                string
	TLSEnabled        bool
	Endpoints         []*PDScript
	ConfigFileEnabled bool
	DataDirEnabled    bool
}

CDCScript represent the data to generate cdc config

func NewCDCScript

func NewCDCScript(ip, deployDir, logDir string, enableTLS bool, gcTTL int64, tz string) *CDCScript

NewCDCScript returns a CDCScript with given arguments

func (*CDCScript) AppendEndpoints

func (c *CDCScript) AppendEndpoints(ends ...*PDScript) *CDCScript

AppendEndpoints add new PDScript to Endpoints field

func (*CDCScript) Config

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

Config generate the config file data.

func (*CDCScript) ConfigToFile

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

ConfigToFile write config content to specific file.

func (*CDCScript) ConfigWithTemplate

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

ConfigWithTemplate generate the CDC config content by tpl

func (*CDCScript) PatchByVersion

func (c *CDCScript) PatchByVersion(clusterVersion, dataDir string) *CDCScript

PatchByVersion update fields by cluster version

func (*CDCScript) WithConfigFileEnabled

func (c *CDCScript) WithConfigFileEnabled() *CDCScript

WithConfigFileEnabled enables config file

func (*CDCScript) WithDataDir

func (c *CDCScript) WithDataDir(dataDir string) *CDCScript

WithDataDir set DataDir field of TiCDCScript

func (*CDCScript) WithDataDirEnabled

func (c *CDCScript) WithDataDirEnabled() *CDCScript

WithDataDirEnabled enables CDC data-dir

func (*CDCScript) WithNumaNode

func (c *CDCScript) WithNumaNode(numa string) *CDCScript

WithNumaNode set NumaNode field of TiCDCScript

func (*CDCScript) WithPort

func (c *CDCScript) WithPort(port int) *CDCScript

WithPort set Port field of TiCDCScript

type DMMasterScaleScript

type DMMasterScaleScript struct {
	DMMasterScript
}

DMMasterScaleScript represent the data to generate dm-master config on scaling

func NewDMMasterScaleScript

func NewDMMasterScaleScript(name, ip, deployDir, dataDir, logDir string) *DMMasterScaleScript

NewDMMasterScaleScript return a new DMMasterScaleScript

func (*DMMasterScaleScript) AppendEndpoints

func (c *DMMasterScaleScript) AppendEndpoints(ends ...*DMMasterScript) *DMMasterScaleScript

AppendEndpoints add new DMMasterScript to Endpoints field

func (*DMMasterScaleScript) Config

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

Config generate the config file data.

func (*DMMasterScaleScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*DMMasterScaleScript) WithNumaNode

func (c *DMMasterScaleScript) WithNumaNode(numa string) *DMMasterScaleScript

WithNumaNode set NumaNode field of DMMasterScript

func (*DMMasterScaleScript) WithPeerPort

func (c *DMMasterScaleScript) WithPeerPort(port int) *DMMasterScaleScript

WithPeerPort set PeerPort field of DMMasterScript

func (*DMMasterScaleScript) WithPort

func (c *DMMasterScaleScript) WithPort(port int) *DMMasterScaleScript

WithPort set Port field of DMMasterScript

func (*DMMasterScaleScript) WithScheme

func (c *DMMasterScaleScript) WithScheme(scheme string) *DMMasterScaleScript

WithScheme set Scheme field of DMMasterScaleScript

type DMMasterScript

type DMMasterScript struct {
	Name         string
	Scheme       string
	IP           string
	Port         int
	PeerPort     int
	DeployDir    string
	DataDir      string
	LogDir       string
	NumaNode     string
	V1SourcePath string
	Endpoints    []*DMMasterScript
}

DMMasterScript represent the data to generate TiDB config

func NewDMMasterScript

func NewDMMasterScript(name, ip, deployDir, dataDir, logDir string) *DMMasterScript

NewDMMasterScript returns a DMMasterScript with given arguments

func (*DMMasterScript) AppendEndpoints

func (c *DMMasterScript) AppendEndpoints(ends ...*DMMasterScript) *DMMasterScript

AppendEndpoints add new DMMasterScript to Endpoints field

func (*DMMasterScript) Config

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

Config generate the config file data.

func (*DMMasterScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*DMMasterScript) ConfigWithTemplate

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

ConfigWithTemplate generate the TiDB config content by tpl

func (*DMMasterScript) WithNumaNode

func (c *DMMasterScript) WithNumaNode(numa string) *DMMasterScript

WithNumaNode set NumaNode field of DMMasterScript

func (*DMMasterScript) WithPeerPort

func (c *DMMasterScript) WithPeerPort(port int) *DMMasterScript

WithPeerPort set PeerPort field of DMMasterScript

func (*DMMasterScript) WithPort

func (c *DMMasterScript) WithPort(port int) *DMMasterScript

WithPort set Port field of DMMasterScript

func (*DMMasterScript) WithScheme

func (c *DMMasterScript) WithScheme(scheme string) *DMMasterScript

WithScheme set Scheme field of NewDMMasterScript

func (*DMMasterScript) WithV1SourcePath

func (c *DMMasterScript) WithV1SourcePath(path string) *DMMasterScript

WithV1SourcePath set Scheme field of V1SourcePath

type DMWorkerScript

type DMWorkerScript struct {
	Name      string
	IP        string
	Port      int
	DeployDir string
	LogDir    string
	NumaNode  string
	Endpoints []*DMMasterScript
}

DMWorkerScript represent the data to generate TiDB config

func NewDMWorkerScript

func NewDMWorkerScript(name, ip, deployDir, logDir string) *DMWorkerScript

NewDMWorkerScript returns a DMWorkerScript with given arguments

func (*DMWorkerScript) AppendEndpoints

func (c *DMWorkerScript) AppendEndpoints(ends ...*DMMasterScript) *DMWorkerScript

AppendEndpoints add new PDScript to Endpoints field

func (*DMWorkerScript) Config

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

Config generate the config file data.

func (*DMWorkerScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*DMWorkerScript) ConfigWithTemplate

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

ConfigWithTemplate generate the DM worker config content by tpl

func (*DMWorkerScript) WithNumaNode

func (c *DMWorkerScript) WithNumaNode(numa string) *DMWorkerScript

WithNumaNode set NumaNode field of DMWorkerScript

func (*DMWorkerScript) WithPort

func (c *DMWorkerScript) WithPort(port int) *DMWorkerScript

WithPort set Port field of DMWorkerScript

type DrainerScript

type DrainerScript struct {
	NodeID    string
	IP        string
	Port      int
	DeployDir string
	DataDir   string
	LogDir    string
	NumaNode  string
	CommitTs  int64
	Endpoints []*PDScript
}

DrainerScript represent the data to generate drainer config

func NewDrainerScript

func NewDrainerScript(nodeID, ip, deployDir, dataDir, logDir string) *DrainerScript

NewDrainerScript returns a DrainerScript with given arguments

func (*DrainerScript) AppendEndpoints

func (c *DrainerScript) AppendEndpoints(ends ...*PDScript) *DrainerScript

AppendEndpoints add new DrainerScript to Endpoints field

func (*DrainerScript) Config

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

Config generate the config file data.

func (*DrainerScript) ConfigToFile

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

ConfigToFile write config content to specific file.

func (*DrainerScript) ConfigWithTemplate

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

ConfigWithTemplate generate the Drainer config content by tpl

func (*DrainerScript) WithCommitTs

func (c *DrainerScript) WithCommitTs(ts int64) *DrainerScript

WithCommitTs set CommitTs field of DrainerScript

func (*DrainerScript) WithNumaNode

func (c *DrainerScript) WithNumaNode(numa string) *DrainerScript

WithNumaNode set NumaNode field of DrainerScript

func (*DrainerScript) WithPort

func (c *DrainerScript) WithPort(port int) *DrainerScript

WithPort set Port field of DrainerScript

type GrafanaScript

type GrafanaScript struct {
	ClusterName string
	DeployDir   string
	NumaNode    string
	// contains filtered or unexported fields
}

GrafanaScript represent the data to generate Grafana config

func NewGrafanaScript

func NewGrafanaScript(cluster, deployDir string) *GrafanaScript

NewGrafanaScript returns a GrafanaScript with given arguments

func (*GrafanaScript) Config

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

Config generate the config file data.

func (*GrafanaScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*GrafanaScript) ConfigWithTemplate

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

ConfigWithTemplate generate the Grafana config content by tpl

func (*GrafanaScript) WithNumaNode

func (c *GrafanaScript) WithNumaNode(numa string) *GrafanaScript

WithNumaNode set NumaNode field of GrafanaScript

func (*GrafanaScript) WithTPLFile

func (c *GrafanaScript) WithTPLFile(file string) *GrafanaScript

WithTPLFile set the template file.

type NodeExporterScript

type NodeExporterScript struct {
	Port      uint64
	DeployDir string
	LogDir    string
	NumaNode  string
}

NodeExporterScript represent the data to generate NodeExporter config

func NewNodeExporterScript

func NewNodeExporterScript(deployDir, logDir string) *NodeExporterScript

NewNodeExporterScript returns a NodeExporterScript with given arguments

func (*NodeExporterScript) Config

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

Config generate the config file data.

func (*NodeExporterScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*NodeExporterScript) ConfigWithTemplate

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

ConfigWithTemplate generate the NodeExporter config content by tpl

func (*NodeExporterScript) WithNumaNode

func (c *NodeExporterScript) WithNumaNode(numa string) *NodeExporterScript

WithNumaNode set NumaNode field of NodeExporterScript

func (*NodeExporterScript) WithPort

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

WithPort set Port field of NodeExporterScript

type PDScaleScript

type PDScaleScript struct {
	PDScript
}

PDScaleScript represent the data to generate pd config on scaling

func NewPDScaleScript

func NewPDScaleScript(pdScript *PDScript) *PDScaleScript

NewPDScaleScript return a new PDScaleScript

func (*PDScaleScript) Config

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

Config generate the config file data.

func (*PDScaleScript) ConfigToFile

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

ConfigToFile write config content to specific path

type PDScript

type PDScript struct {
	Name                string
	Scheme              string
	IP                  string
	ListenHost          string
	AdvertiseClientAddr string
	AdvertisePeerAddr   string
	ClientPort          int
	PeerPort            int
	DeployDir           string
	DataDir             string
	LogDir              string
	NumaNode            string
	Endpoints           []*PDScript
}

PDScript represent the data to generate pd config

func NewPDScript

func NewPDScript(name, ip, deployDir, dataDir, logDir string) *PDScript

NewPDScript returns a PDScript with given arguments

func (*PDScript) AppendEndpoints

func (c *PDScript) AppendEndpoints(ends ...*PDScript) *PDScript

AppendEndpoints add new PDScript to Endpoints field

func (*PDScript) Config

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

Config generate the config file data.

func (*PDScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*PDScript) ConfigWithTemplate

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

ConfigWithTemplate generate the PD config content by tpl

func (*PDScript) WithAdvertiseClientAddr

func (c *PDScript) WithAdvertiseClientAddr(addr string) *PDScript

WithAdvertiseClientAddr set AdvertiseClientAddr field of PDScript

func (*PDScript) WithAdvertisePeerAddr

func (c *PDScript) WithAdvertisePeerAddr(addr string) *PDScript

WithAdvertisePeerAddr set AdvertisePeerAddr field of PDScript

func (*PDScript) WithClientPort

func (c *PDScript) WithClientPort(port int) *PDScript

WithClientPort set ClientPort field of PDScript

func (*PDScript) WithListenHost

func (c *PDScript) WithListenHost(listenHost string) *PDScript

WithListenHost set listenHost field of PDScript

func (*PDScript) WithNumaNode

func (c *PDScript) WithNumaNode(numa string) *PDScript

WithNumaNode set NumaNode field of PDScript

func (*PDScript) WithPeerPort

func (c *PDScript) WithPeerPort(port int) *PDScript

WithPeerPort set PeerPort field of PDScript

func (*PDScript) WithScheme

func (c *PDScript) WithScheme(scheme string) *PDScript

WithScheme set Scheme field of PDScript

type PrometheusScript

type PrometheusScript struct {
	IP        string
	Port      int
	DeployDir string
	DataDir   string
	LogDir    string
	NumaNode  string
	Retention string
	// contains filtered or unexported fields
}

PrometheusScript represent the data to generate Prometheus config

func NewPrometheusScript

func NewPrometheusScript(ip, deployDir, dataDir, logDir string) *PrometheusScript

NewPrometheusScript returns a PrometheusScript with given arguments

func (*PrometheusScript) Config

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

Config generate the config file data.

func (*PrometheusScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*PrometheusScript) ConfigWithTemplate

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

ConfigWithTemplate generate the Prometheus config content by tpl

func (*PrometheusScript) WithNumaNode

func (c *PrometheusScript) WithNumaNode(numa string) *PrometheusScript

WithNumaNode set NumaNode field of PrometheusScript

func (*PrometheusScript) WithPort

func (c *PrometheusScript) WithPort(port int) *PrometheusScript

WithPort set Port field of PrometheusScript

func (*PrometheusScript) WithRetention

func (c *PrometheusScript) WithRetention(retention string) *PrometheusScript

WithRetention set Retention field of PrometheusScript

func (*PrometheusScript) WithTPLFile

func (c *PrometheusScript) WithTPLFile(fname string) *PrometheusScript

WithTPLFile set the template file.

type PumpScript

type PumpScript struct {
	NodeID    string
	Host      string
	Port      int
	DeployDir string
	DataDir   string
	LogDir    string
	NumaNode  string
	CommitTs  int64
	Endpoints []*PDScript
}

PumpScript represent the data to generate Pump config

func NewPumpScript

func NewPumpScript(nodeID, host, deployDir, dataDir, logDir string) *PumpScript

NewPumpScript returns a PumpScript with given arguments

func (*PumpScript) AppendEndpoints

func (c *PumpScript) AppendEndpoints(ends ...*PDScript) *PumpScript

AppendEndpoints add new PumpScript to Endpoints field

func (*PumpScript) Config

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

Config generate the config file data.

func (*PumpScript) ConfigToFile

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

ConfigToFile write config content to specific file.

func (*PumpScript) ConfigWithTemplate

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

ConfigWithTemplate generate the Pump config content by tpl

func (*PumpScript) WithNumaNode

func (c *PumpScript) WithNumaNode(numa string) *PumpScript

WithNumaNode set NumaNode field of PumpScript

func (*PumpScript) WithPort

func (c *PumpScript) WithPort(port int) *PumpScript

WithPort set Port field of PumpScript

type TiDBScript

type TiDBScript struct {
	IP            string
	ListenHost    string
	AdvertiseAddr string
	Port          int
	StatusPort    int
	DeployDir     string
	LogDir        string
	NumaNode      string
	Endpoints     []*PDScript
}

TiDBScript represent the data to generate TiDB config

func NewTiDBScript

func NewTiDBScript(ip, deployDir, logDir string) *TiDBScript

NewTiDBScript returns a TiDBScript with given arguments

func (*TiDBScript) AppendEndpoints

func (c *TiDBScript) AppendEndpoints(ends ...*PDScript) *TiDBScript

AppendEndpoints add new PDScript to Endpoints field

func (*TiDBScript) Config

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

Config generate the config file data.

func (*TiDBScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*TiDBScript) ConfigWithTemplate

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

ConfigWithTemplate generate the TiDB config content by tpl

func (*TiDBScript) WithAdvertiseAddr

func (c *TiDBScript) WithAdvertiseAddr(addr string) *TiDBScript

WithAdvertiseAddr set AdvertiseAddr field of TiDBScript

func (*TiDBScript) WithListenHost

func (c *TiDBScript) WithListenHost(listenHost string) *TiDBScript

WithListenHost set ListenHost field of TiDBScript

func (*TiDBScript) WithNumaNode

func (c *TiDBScript) WithNumaNode(numa string) *TiDBScript

WithNumaNode set NumaNode field of TiDBScript

func (*TiDBScript) WithPort

func (c *TiDBScript) WithPort(port int) *TiDBScript

WithPort set Port field of TiDBScript

func (*TiDBScript) WithStatusPort

func (c *TiDBScript) WithStatusPort(port int) *TiDBScript

WithStatusPort set StatusPort field of TiDBScript

type TiFlashScript

type TiFlashScript struct {
	IP                   string
	TCPPort              int
	HTTPPort             int
	FlashServicePort     int
	FlashProxyPort       int
	FlashProxyStatusPort int
	StatusPort           int
	DeployDir            string
	DataDir              string
	LogDir               string
	TmpDir               string
	NumaNode             string
	Endpoints            []*PDScript
	TiDBStatusAddrs      string
	PDAddrs              string
}

TiFlashScript represent the data to generate TiFlash config

func NewTiFlashScript

func NewTiFlashScript(ip, deployDir, dataDir string, logDir string, tidbStatusAddrs string, pdAddrs string) *TiFlashScript

NewTiFlashScript returns a TiFlashScript with given arguments

func (*TiFlashScript) AppendEndpoints

func (c *TiFlashScript) AppendEndpoints(ends ...*PDScript) *TiFlashScript

AppendEndpoints add new PDScript to Endpoints field

func (*TiFlashScript) Config

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

Config generate the config file data.

func (*TiFlashScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*TiFlashScript) ConfigWithTemplate

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

ConfigWithTemplate generate the TiFlash config content by tpl

func (*TiFlashScript) WithFlashProxyPort

func (c *TiFlashScript) WithFlashProxyPort(port int) *TiFlashScript

WithFlashProxyPort set FlashProxyPort field of TiFlashScript

func (*TiFlashScript) WithFlashProxyStatusPort

func (c *TiFlashScript) WithFlashProxyStatusPort(port int) *TiFlashScript

WithFlashProxyStatusPort set FlashProxyStatusPort field of TiFlashScript

func (*TiFlashScript) WithFlashServicePort

func (c *TiFlashScript) WithFlashServicePort(port int) *TiFlashScript

WithFlashServicePort set FlashServicePort field of TiFlashScript

func (*TiFlashScript) WithHTTPPort

func (c *TiFlashScript) WithHTTPPort(port int) *TiFlashScript

WithHTTPPort set HTTPPort field of TiFlashScript

func (*TiFlashScript) WithNumaNode

func (c *TiFlashScript) WithNumaNode(numa string) *TiFlashScript

WithNumaNode set NumaNode field of TiFlashScript

func (*TiFlashScript) WithStatusPort

func (c *TiFlashScript) WithStatusPort(port int) *TiFlashScript

WithStatusPort set FlashProxyStatusPort field of TiFlashScript

func (*TiFlashScript) WithTCPPort

func (c *TiFlashScript) WithTCPPort(port int) *TiFlashScript

WithTCPPort set TCPPort field of TiFlashScript

func (*TiFlashScript) WithTmpDir

func (c *TiFlashScript) WithTmpDir(tmpDir string) *TiFlashScript

WithTmpDir set TmpDir field of TiFlashScript

type TiKVScript

type TiKVScript struct {
	IP                         string
	ListenHost                 string
	AdvertiseAddr              string
	AdvertiseStatusAddr        string
	Port                       int
	StatusPort                 int
	DeployDir                  string
	DataDir                    string
	LogDir                     string
	SupportAdvertiseStatusAddr bool
	NumaNode                   string
	Endpoints                  []*PDScript
}

TiKVScript represent the data to generate TiKV config

func NewTiKVScript

func NewTiKVScript(version, ip string, port, statusPort int, deployDir, dataDir, logDir string) *TiKVScript

NewTiKVScript returns a TiKVScript with given arguments

func (*TiKVScript) AppendEndpoints

func (c *TiKVScript) AppendEndpoints(ends ...*PDScript) *TiKVScript

AppendEndpoints add new PDScript to Endpoints field

func (*TiKVScript) Config

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

Config generate the config file data.

func (*TiKVScript) ConfigToFile

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

ConfigToFile write config content to specific path

func (*TiKVScript) ConfigWithTemplate

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

ConfigWithTemplate generate the TiKV config content by tpl

func (*TiKVScript) WithAdvertiseAddr

func (c *TiKVScript) WithAdvertiseAddr(addr string) *TiKVScript

WithAdvertiseAddr set AdvertiseAddr of TiKVScript

func (*TiKVScript) WithAdvertiseStatusAddr

func (c *TiKVScript) WithAdvertiseStatusAddr(addr string) *TiKVScript

WithAdvertiseStatusAddr set AdvertiseStatusAddr of TiKVScript

func (*TiKVScript) WithListenHost

func (c *TiKVScript) WithListenHost(listenHost string) *TiKVScript

WithListenHost set ListenHost field of TiKVScript

func (*TiKVScript) WithNumaNode

func (c *TiKVScript) WithNumaNode(numa string) *TiKVScript

WithNumaNode set NumaNode field of TiKVScript

type TiSparkEnv

type TiSparkEnv struct {
	Host           string
	TiSparkMaster  string
	TiSparkLocalIP string
	MasterPort     int
	WorkerPort     int
	MasterUIPort   int
	WorkerUIPort   int
	CustomEnvs     map[string]string
}

TiSparkEnv represent the data to generate TiSpark environment config

func NewTiSparkEnv

func NewTiSparkEnv(host string) *TiSparkEnv

NewTiSparkEnv returns a TiSparkConfig

func (*TiSparkEnv) Script

func (c *TiSparkEnv) Script() ([]byte, error)

Script generate the script file data.

func (*TiSparkEnv) ScriptToFile

func (c *TiSparkEnv) ScriptToFile(file string) error

ScriptToFile write script content to specific path

func (*TiSparkEnv) ScriptWithTemplate

func (c *TiSparkEnv) ScriptWithTemplate(tpl string) ([]byte, error)

ScriptWithTemplate parses the template file

func (*TiSparkEnv) SlaveScriptWithTemplate

func (c *TiSparkEnv) SlaveScriptWithTemplate() ([]byte, error)

SlaveScriptWithTemplate parses the template file

func (*TiSparkEnv) WithCustomEnv

func (c *TiSparkEnv) WithCustomEnv(m map[string]string) *TiSparkEnv

WithCustomEnv sets custom setting fields

func (*TiSparkEnv) WithLocalIP

func (c *TiSparkEnv) WithLocalIP(ip string) *TiSparkEnv

WithLocalIP sets custom setting fields

func (*TiSparkEnv) WithMaster

func (c *TiSparkEnv) WithMaster(master string) *TiSparkEnv

WithMaster sets master field

func (*TiSparkEnv) WithMasterPorts

func (c *TiSparkEnv) WithMasterPorts(port, ui int) *TiSparkEnv

WithMasterPorts sets port for masters

func (*TiSparkEnv) WithWorkerPorts

func (c *TiSparkEnv) WithWorkerPorts(port, ui int) *TiSparkEnv

WithWorkerPorts sets port for masters

Jump to

Keyboard shortcuts

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