config

package
v0.1.0-beta.8 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateArtifact

func ValidateArtifact(sl validator.StructLevel)

func ValidateConfig

func ValidateConfig(config *BareMetalClusterConfig) error

ValidateConfig validate config in bare-metal mode.

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 BareMetalClusterComponentsConfig

type BareMetalClusterComponentsConfig 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 BareMetalClusterConfig

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

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

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

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

func DefaultBareMetalConfig

func DefaultBareMetalConfig() *BareMetalClusterConfig

type BareMetalClusterMetadata

type BareMetalClusterMetadata struct {
	Config        *BareMetalClusterConfig `yaml:"config"`
	CreationDate  time.Time               `yaml:"creationDate"`
	ClusterDir    string                  `yaml:"clusterDir"`
	ForegroundPid int                     `yaml:"foregroundPid"`
}

BareMetalClusterMetadata stores metadata of a GreptimeDB cluster.

type Datanode

type Datanode struct {
	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"`

	Replicas int    `yaml:"replicas" validate:"gt=0"`
	Config   string `yaml:"config" validate:"omitempty,filepath"`
	LogLevel string `yaml:"logLevel"`
}

type Etcd

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

type Frontend

type Frontend struct {
	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"`
	MysqlAddr    string `yaml:"mysqlAddr" validate:"omitempty,hostname_port"`
	OpentsdbAddr string `yaml:"opentsdbAddr" validate:"omitempty,hostname_port"`

	Replicas int    `yaml:"replicas" validate:"gt=0"`
	Config   string `yaml:"config" validate:"omitempty,filepath"`
	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"`

	Replicas int    `yaml:"replicas" validate:"gt=0"`
	Config   string `yaml:"config" validate:"omitempty,filepath"`
	LogLevel string `yaml:"logLevel"`
}

type SetValues

type SetValues struct {
	RawConfig []string

	OperatorConfig string
	ClusterConfig  string
	EtcdConfig     string
}

func (*SetValues) Parse

func (c *SetValues) Parse() error

Parse parses raw config values and classify it to different categories of config type by its prefix.

Jump to

Keyboard shortcuts

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