config

package
v0.0.0-...-c3186a4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package config contains common configuration to all commands & control abstractions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Environment is the current environment ctpu is running in
	Environment string
	// The current active configuration we are using as default.
	ActiveConfiguration string
	// The "flock" name to use when creating the VMs and TPUs
	FlockName string
	// The GCP project we will use to allocate / deallocate TPUs and VMs.
	Project string
	// The Compute Engine zone we will use to allocate / deallocate TPUs and VMs.
	Zone string
	// contains filtered or unexported fields
}

Config encapsulates all common configuration required to execute a command.

func FromEnv

func FromEnv() (cfg *Config, err error)

FromEnv constructs a Config object from the environment.

func (*Config) SetFlags

func (c *Config) SetFlags(f *flag.FlagSet)

SetFlags registers flag overrides for the config object.

func (*Config) Validate

func (c *Config) Validate() error

Validate verifies that the configuration has been fully populated.

Jump to

Keyboard shortcuts

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