config

package
v0.1.0-alpha.17 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// GtctlDir is the root directory that contains states of cluster info.
	GtctlDir = ".gtctl"

	DefaultEtcdVersion     = "v3.5.7"
	DefaultGreptimeVersion = "latest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	// Local is the local path of binary(greptime or etcd).
	Local string `yaml:"local" validate:"omitempty,file"`

	// Version is the release version of binary(greptime or etcd).
	// Usually, it points to the version of binary of GitHub release.
	Version string `yaml:"version"`
}

type Cluster

type Cluster struct {
	Artifact *Artifact `yaml:"artifact" validate:"required"`
	Frontend *Frontend `yaml:"frontend" validate:"required"`
	MetaSrv  *MetaSrv  `yaml:"meta" validate:"required"`
	Datanode *Datanode `yaml:"datanode" validate:"required"`
}

type Config

type Config struct {
	Cluster *Cluster `yaml:"cluster" validate:"required"`
	Etcd    *Etcd    `yaml:"etcd" validate:"required"`
}

Config is the desired state of a GreptimeDB cluster on bare metal.

The field of Config that with `validate` tag will be validated against its requirement. Each filed has only one requirement.

Each field of Config can also have its own exported method `Validate`.

func DefaultConfig

func DefaultConfig() *Config

type Datanode

type Datanode struct {
	Replicas int `yaml:"replicas" validate:"gt=0"`
	NodeID   int `yaml:"nodeID" validate:"gte=0"`

	RPCAddr  string `yaml:"rpcAddr" validate:"required,hostname_port"`
	HTTPAddr string `yaml:"httpAddr" validate:"required,hostname_port"`

	DataDir      string `yaml:"dataDir" validate:"omitempty,dirpath"`
	WalDir       string `yaml:"walDir" validate:"omitempty,dirpath"`
	ProcedureDir string `yaml:"procedureDir" validate:"omitempty,dirpath"`

	LogLevel string `yaml:"logLevel"`
}

type Etcd

type Etcd struct {
	Artifact *Artifact `yaml:"artifact" validate:"required"`
}

type Frontend

type Frontend struct {
	Replicas int `yaml:"replicas" validate:"gt=0"`

	GRPCAddr     string `yaml:"grpcAddr" validate:"omitempty,hostname_port"`
	HTTPAddr     string `yaml:"httpAddr" validate:"omitempty,hostname_port"`
	PostgresAddr string `yaml:"postgresAddr" validate:"omitempty,hostname_port"`
	MetaAddr     string `yaml:"metaAddr" validate:"omitempty,hostname_port"`

	LogLevel string `yaml:"logLevel"`
}

type MetaSrv

type MetaSrv struct {
	StoreAddr  string `yaml:"storeAddr" validate:"hostname_port"`
	ServerAddr string `yaml:"serverAddr" validate:"hostname_port"`
	BindAddr   string `yaml:"bindAddr" validate:"omitempty,hostname_port"`
	HTTPAddr   string `yaml:"httpAddr" validate:"required,hostname_port"`

	LogLevel string `yaml:"logLevel"`
}

Jump to

Keyboard shortcuts

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