config

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DevKeyGeneration added in v0.1.8

func DevKeyGeneration() (string, string, string)

Types

type Config

type Config struct {
	*configutil.SharedConfig `hcl:"-"`

	Worker     *Worker     `hcl:"worker"`
	Controller *Controller `hcl:"controller"`

	// Dev-related options
	DevController       bool   `hcl:"-"`
	DevUiPassthroughDir string `hcl:"-"`
	DevControllerKey    string `hcl:"-"`
	DevWorkerAuthKey    string `hcl:"-"`
	DevRecoveryKey      string `hcl:"-"`

	// Eventing configuration for the controller
	Eventing *event.EventerConfig `hcl:"events"`

	// Plugin-related options
	Plugins Plugins `hcl:"plugins"`
}

Config is the configuration for the boundary controller

func DevCombined

func DevCombined() (*Config, error)

func DevController

func DevController() (*Config, error)

DevController is a Config that is used for dev mode of Boundary controllers

func DevWorker

func DevWorker() (*Config, error)

DevWorker is a Config that is used for dev mode of Boundary workers

func LoadFile

func LoadFile(path string, wrapper wrapping.Wrapper) (*Config, error)

LoadFile loads the configuration from the given file.

func New

func New() *Config

func Parse

func Parse(d string) (*Config, error)

func (*Config) Sanitized

func (c *Config) Sanitized() map[string]interface{}

Sanitized returns a copy of the config with all values that are considered sensitive stripped. It also strips all `*Raw` values that are mainly used for parsing.

Specifically, the fields that this method strips are: - KMS.Config - Telemetry.CirconusAPIToken

type Controller

type Controller struct {
	Name              string    `hcl:"name"`
	Description       string    `hcl:"description"`
	Database          *Database `hcl:"database"`
	PublicClusterAddr string    `hcl:"public_cluster_addr"`

	// AuthTokenTimeToLive is the total valid lifetime of a token denoted by time.Duration
	AuthTokenTimeToLive         interface{} `hcl:"auth_token_time_to_live"`
	AuthTokenTimeToLiveDuration time.Duration

	// AuthTokenTimeToStale is the total time a token can go unused before becoming invalid
	// denoted by time.Duration
	AuthTokenTimeToStale         interface{} `hcl:"auth_token_time_to_stale"`
	AuthTokenTimeToStaleDuration time.Duration

	// GracefulShutdownWait is the amount of time that we'll wait before actually
	// starting the Controller shutdown. This allows the health endpoint to
	// return a status code to indicate that the instance is shutting down.
	GracefulShutdownWait         interface{} `hcl:"graceful_shutdown_wait_duration"`
	GracefulShutdownWaitDuration time.Duration

	// StatusGracePeriod represents the period of time (as a duration) that the
	// controller will wait before marking connections from a disconnected worker
	// as invalid.
	//
	// TODO: This field is currently internal.
	StatusGracePeriodDuration time.Duration `hcl:"-"`

	// SchedulerRunJobInterval is the time interval between waking up the
	// scheduler to run pending jobs.
	//
	// TODO: This field is currently internal.
	SchedulerRunJobInterval time.Duration `hcl:"-"`
}

func (*Controller) InitNameIfEmpty added in v0.5.0

func (c *Controller) InitNameIfEmpty() (string, error)

type Database

type Database struct {
	Url                   string      `hcl:"url"`
	MigrationUrl          string      `hcl:"migration_url"`
	MaxOpenConnections    int         `hcl:"-"`
	MaxOpenConnectionsRaw interface{} `hcl:"max_open_connections"`
}

type Plugins added in v0.7.0

type Plugins struct {
	ExecutionDir string `hcl:"execution_dir"`
}

type Worker

type Worker struct {
	Name        string `hcl:"name"`
	Description string `hcl:"description"`
	PublicAddr  string `hcl:"public_addr"`

	// We use a raw interface here so that we can take in a string
	// value pointing to an env var or file. We then resolve that
	// and get the actual controller addresses.
	Controllers    []string    `hcl:"-"`
	ControllersRaw interface{} `hcl:"controllers"`

	// We use a raw interface for parsing so that people can use JSON-like
	// syntax that maps directly to the filter input or possibly more familiar
	// key=value syntax, as well as accepting a string denoting an env or file
	// pointer. This is trued up in the Parse function below.
	Tags    map[string][]string `hcl:"-"`
	TagsRaw interface{}         `hcl:"tags"`

	// StatusGracePeriod represents the period of time (as a duration) that the
	// worker will wait before disconnecting connections if it cannot make a
	// status report to a controller.
	//
	// TODO: This field is currently internal.
	StatusGracePeriodDuration time.Duration `hcl:"-"`
}

func (*Worker) InitNameIfEmpty added in v0.5.0

func (w *Worker) InitNameIfEmpty() (string, error)

Jump to

Keyboard shortcuts

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