config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenConfs

func GenConfs(y Yaml, template Toml, path string) error

func GenNewToml

func GenNewToml(t Toml, path string) error

Types

type CommonConfig

type CommonConfig struct {
	MetaHosts  []string //IPs
	StoreHosts []string
	SqlHosts   []string
	User       string
	Os         string
	Arch       string
}

type CommonToml

type CommonToml struct {
	MetaJoin []string `toml:"meta-join"`
	HaPolicy string   `toml:"ha-policy"`
}

type Config

type Config struct {
	CommonConfig *CommonConfig
	SSHConfig    map[string]SSHConfig
}

type Configurator

type Configurator interface {
	GenClusterConfs() error
	BuildConfig() error
	GetConfig() *Config
}

func NewGeminiConfigurator

func NewGeminiConfigurator(yPath, tPath, gPath string) Configurator

type DataToml

type DataToml struct {
	StoreIngestAddr     string `toml:"store-ingest-addr"`
	StoreSelectAddr     string `toml:"store-select-addr"`
	StoreDataDir        string `toml:"store-data-dir"`
	StoreWalDir         string `toml:"store-wal-dir"`
	StoreMetaDir        string `toml:"store-meta-dir"`
	CacheTableDataBlock bool   `toml:"cache-table-data-block"`
	CacheTableMetaBlock bool   `toml:"cache-table-meta-block"`
	ReadCacheLimit      int    `toml:"read-cache-limit"`
}

type GeminiConfigurator

type GeminiConfigurator struct {
	// contains filtered or unexported fields
}

func (*GeminiConfigurator) BuildConfig

func (c *GeminiConfigurator) BuildConfig() error

func (*GeminiConfigurator) GenClusterConfs

func (c *GeminiConfigurator) GenClusterConfs() error

func (*GeminiConfigurator) GetConfig

func (c *GeminiConfigurator) GetConfig() *Config

type GlobalYaml

type GlobalYaml struct {
	SSHPort   int    `yaml:"ssh_port"`
	User      string `yaml:"user"`
	LogDir    string `yaml:"log_dir"`
	DeployDir string `yaml:"deploy_dir"`

	OS   string `yaml:"os"`
	Arch string `yaml:"arch"`
}

type GossipToml

type GossipToml struct {
	BindAddress   string   `toml:"bind-address"`
	StoreBindPort int      `toml:"store-bind-port"`
	MetaBindPort  int      `toml:"meta-bind-port"`
	Members       []string `toml:"members"`
}

type HostFile

type HostFile struct {
	Ip       string
	HasMeta  bool
	HasSql   bool
	HasStore bool
	TsMeta   MetaYaml
	TsSql    SqlYaml
	TsStore  StoreYaml
}

type HttpToml

type HttpToml struct {
	BindAddress string `toml:"bind-address"`

	AuthEnabled      bool   `toml:"auth-enabled"`
	HttpsEnabled     bool   `toml:"https-enabled"`
	HttpsCertificate string `toml:"https-certificate"`
	HttpsPrivateKey  string `toml:"https-private-key"`
}

type LoggingToml

type LoggingToml struct {
	Path string `toml:"path"`
}

type MetaPorts

type MetaPorts struct {
	Ip     string
	Peer   int
	Gossip int
}

type MetaToml

type MetaToml struct {
	BindAddress     string `toml:"bind-address"`
	HttpBindAddress string `toml:"http-bind-address"`
	RpcBindAddress  string `toml:"rpc-bind-address"`
	Dir             string `toml:"dir"`
}

type MetaYaml

type MetaYaml struct {
	Host string `yaml:"host"`
	// default value in GlobalYaml
	SSHPort   int    `yaml:"ssh_port"`
	LogDir    string `yaml:"log_dir"`
	DeployDir string `yaml:"deploy_dir"`

	// do not need default value
	ClientPort int    `yaml:"client_port"`
	PeerPort   int    `yaml:"peer_port"`
	RaftPort   int    `yaml:"raft_port"`
	GossipPort int    `yaml:"gossip_port"`
	DataDir    string `yaml:"data_dir"`

	Config MetaYamlConfig `yaml:"config"`
}

type MetaYamlConfig

type MetaYamlConfig struct {
	HaPolicy string `yaml:"common.ha-policy"`

	Pushers       string `yaml:"monitor.pushers"`
	StoreEnabled  bool   `yaml:"monitor.store-enabled"`
	StoreDatabase string `yaml:"monitor.store-interval"`
	StoreInterval string `yaml:"monitor.store-database"`
	StorePath     string `yaml:"monitor.store-path"`
	Compress      bool   `yaml:"monitor.compress"`
	HttpEndpoint  string `yaml:"monitor.http-endpoint"`
	Username      string `yaml:"monitor.username"`
	Password      string `yaml:"monitor.password"`
}

type MonitorToml

type MonitorToml struct {
	Pushers       string `toml:"pushers"`
	StoreEnabled  bool   `toml:"store-enabled"`
	StoreDatabase string `toml:"store-interval"`
	StoreInterval string `toml:"store-database"`
	StorePath     string `toml:"store-path"`
	Compress      bool   `toml:"compress"`
	HttpEndpoint  string `toml:"http-endpoint"`
	Username      string `toml:"username"`
	Password      string `toml:"password"`
}

type RemoteHost

type RemoteHost struct {
	Ip         string
	SSHPort    int
	User       string
	Password   string
	KeyPath    string
	Typ        utils.SSHType
	UpDataPath string
	LogPath    string
}

used by install, exe, stop .etc

type RetentionToml

type RetentionToml struct {
	CheckInterval string `toml:"check-interval"`
}

type SSHConfig

type SSHConfig struct {
	// get from yaml
	Port       int
	UpDataPath string
	LogPath    string
}

type ServerConfig

type ServerConfig struct {
	TsMeta  MetaYamlConfig  `yaml:"ts-meta"`
	TsSql   SqlYamlConfig   `yaml:"ts-sql"`
	TsStore StoreYamlConfig `yaml:"ts-store"`
}

type SqlYaml

type SqlYaml struct {
	Host string `yaml:"host"`
	// default value in GlobalYaml
	SSHPort   int    `yaml:"ssh_port"`
	LogDir    string `yaml:"log_dir"`
	DeployDir string `yaml:"deploy_dir"`

	// do not need default value
	Port       int `yaml:"port"`
	FlightPort int `yaml:"flight_port"`

	Config SqlYamlConfig `yaml:"config"`
}

type SqlYamlConfig

type SqlYamlConfig struct {
	AuthEnabled      bool   `yaml:"http.auth-enabled"`
	HttpsEnabled     bool   `yaml:"http.https-enabled"`
	HttpsCertificate string `yaml:"http.https-certificate"`
	HttpsPrivateKey  string `yaml:"http.https-private-key"`

	HaPolicy string `yaml:"common.ha-policy"`

	Pushers       string `yaml:"monitor.pushers"`
	StoreEnabled  bool   `yaml:"monitor.store-enabled"`
	StoreDatabase string `yaml:"monitor.store-interval"`
	StoreInterval string `yaml:"monitor.store-database"`
	StorePath     string `yaml:"monitor.store-path"`
	Compress      bool   `yaml:"monitor.compress"`
	HttpEndpoint  string `yaml:"monitor.http-endpoint"`
	Username      string `yaml:"monitor.username"`
	Password      string `yaml:"monitor.password"`
}

type StoreYaml

type StoreYaml struct {
	Host string `yaml:"host"`
	// default value in GlobalYaml
	SSHPort   int    `yaml:"ssh_port"`
	LogDir    string `yaml:"log_dir"`
	DeployDir string `yaml:"deploy_dir"`

	// do not need default value
	IngestPort int    `yaml:"ingest_port"`
	SelectPort int    `yaml:"select_port"`
	GossipPort int    `yaml:"gossip_port"`
	DataDir    string `yaml:"data_dir"`
	MetaDir    string `yaml:"meta_dir"`

	Config StoreYamlConfig `yaml:"config"`
}

type StoreYamlConfig

type StoreYamlConfig struct {
	HaPolicy string `yaml:"common.ha-policy"`

	Pushers       string `yaml:"monitor.pushers"`
	StoreEnabled  bool   `yaml:"monitor.store-enabled"`
	StoreDatabase string `yaml:"monitor.store-interval"`
	StoreInterval string `yaml:"monitor.store-database"`
	StorePath     string `yaml:"monitor.store-path"`
	Compress      bool   `yaml:"monitor.compress"`
	HttpEndpoint  string `yaml:"monitor.http-endpoint"`
	Username      string `yaml:"monitor.username"`
	Password      string `yaml:"monitor.password"`

	CheckInterval string `yaml:"retention.check-interval"`
}

type Toml

type Toml struct {
	Common    CommonToml    `toml:"common"`
	Meta      MetaToml      `toml:"meta"`
	Http      HttpToml      `toml:"http"`
	Data      DataToml      `toml:"data"`
	Logging   LoggingToml   `toml:"logging"`
	Gossip    GossipToml    `toml:"gossip"`
	Monitor   MonitorToml   `toml:"monitor"`
	Retention RetentionToml `toml:"retention"`
}

func ConvertToml

func ConvertToml(hostToml Toml, pwd string) Toml

func ReadFromToml

func ReadFromToml(tomlPath string) (Toml, error)

type UploadInfo

type UploadInfo struct {
	LocalPath  string
	RemotePath string
	FileName   string
}

type Yaml

type Yaml struct {
	Global       GlobalYaml   `yaml:"global"`
	ServerConfig ServerConfig `yaml:"server_config"`
	TsMeta       []MetaYaml   `yaml:"ts-meta"`
	TsSql        []SqlYaml    `yaml:"ts-sql"`
	TsStore      []StoreYaml  `yaml:"ts-store"`
}

func ReadFromYaml

func ReadFromYaml(yamlPath string) (Yaml, error)

Jump to

Keyboard shortcuts

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