config

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	// NodeBuildPath specifies the local fs path to the m3db binary
	NodeBuildPath string

	// NodeConfigPath specifies the local fs path to the m3db configuration
	NodeConfigPath string

	// DTestConfigPath specifies the local fs path to the m3em configuration
	DTestConfigPath string

	// NumNodes specifies the number of nodes to use from the m3em configuration
	NumNodes int

	// SessionToken specifies the token used during remote operations
	SessionToken string

	// SessionOverride specifies if exisiting dtests maybe overridden on remote
	// agents
	SessionOverride bool

	// InitialReset specifies if a Teardown() call should be made to remote
	// agents before running a test. It's useful to reset a running agent
	// in the event of an earlier run crashing.
	InitialReset bool
}

Args represents the CLI arguments to be set during a dtest

func (*Args) RegisterFlags

func (a *Args) RegisterFlags(cmd *cobra.Command)

RegisterFlags registers all the common flags

func (*Args) Validate

func (a *Args) Validate() error

Validate validates the set options

type Configuration

type Configuration struct {
	DTest DTestConfig              `yaml:"dtest"`
	M3EM  M3EMConfig               `yaml:"m3em"`
	KV    etcdclient.Configuration `yaml:"kv"`
}

Configuration is a collection of knobs to control test behavior

func New

func New(m3emConfigPath string) (*Configuration, error)

New constructs a Configuration object from the path specified

func (*Configuration) Nodes

func (c *Configuration) Nodes(opts node.Options, numNodes int) ([]m3emnode.Node, error)

Nodes returns a slice of m3emnode.Nodes per the config provided

func (*Configuration) Zone

func (c *Configuration) Zone() (string, error)

Zone returns the zone configured for kv, and the instances if they are all the same; it returns an error if they're not.

type DTestConfig

type DTestConfig struct {
	DebugPort               int                 `yaml:"debugPort" validate:"nonzero"`
	BootstrapTimeout        time.Duration       `yaml:"bootstrapTimeout" validate:"nonzero"`
	BootstrapReportInterval time.Duration       `yaml:"bootstrapReportInterval" validate:"nonzero"`
	NodePort                int                 `yaml:"nodePort" validate:"nonzero"`
	ServiceID               string              `yaml:"serviceID" validate:"nonzero"`
	DataDir                 string              `yaml:"dataDir" validate:"nonzero"` // path relative to m3em agent working directory
	Seeds                   []SeedConfig        `yaml:"seeds"`
	Instances               []PlacementInstance `yaml:"instances" validate:"min=1"`
}

DTestConfig is a collection of DTest configs

type M3EMConfig

type M3EMConfig struct {
	AgentPort     int                   `yaml:"agentPort" validate:"nonzero"`
	AgentTLS      *TLSConfiguration     `yaml:"agentTLS"`
	HeartbeatPort int                   `yaml:"heartbeatPort" validate:"nonzero"`
	Node          node.Configuration    `yaml:"node"`
	Cluster       cluster.Configuration `yaml:"cluster"`
}

M3EMConfig is a list of m3em environment settings

type PlacementInstance

type PlacementInstance struct {
	ID       string `yaml:"id" validate:"nonzero"`
	Rack     string `yaml:"rack" validate:"nonzero"`
	Zone     string `yaml:"zone" validate:"nonzero"`
	Weight   uint32 `yaml:"weight" validate:"nonzero"`
	Hostname string `yaml:"hostname" validate:"nonzero"`
}

PlacementInstance is a config for a placement instance.

type SeedConfig

type SeedConfig struct {
	Namespace     string        `yaml:"namespace" validate:"nonzero"`
	LocalShardNum uint32        `yaml:"localShardNum" validate:"nonzero"`
	Retention     time.Duration `yaml:"retention" validate:"nonzero"`
	BlockSize     time.Duration `yaml:"blockSize" validate:"nonzero"`
	Delay         time.Duration `yaml:"delay"`
}

SeedConfig is a collection of Seed Data configurations

type TLSConfiguration

type TLSConfiguration struct {
	ServerName    string `yaml:"serverName" validate:"nonzero"`
	CACrtPath     string `yaml:"caCrt" validate:"nonzero"`
	ClientCrtPath string `yaml:"clientCrt" validate:"nonzero"`
	ClientKeyPath string `yaml:"clientKey" validate:"nonzero"`
}

TLSConfiguration are the resources required for TLS Communication

func (TLSConfiguration) Credentials

Credentials returns the TransportCredentials corresponding to the provided struct

Jump to

Keyboard shortcuts

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