config

package
v0.34.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

config contains functionality for reading Radius' configuration and interacting with it.

NOTE: right now the workspace loading code lives in the CLI package (parent of this one). It should be moved here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectoryConfig

type DirectoryConfig struct {
	// Filepath is the filepath that was used to the read the configuration. This is
	// not stored in the file, and set by the configuration system for diagnotic purposes.
	Filepath string `yaml:"-"`

	// Workspace contains settings that affect the behavior of the current workspace.
	Workspace DirectoryWorkspaceConfig `yaml:"workspace,omitempty"`
}

DirectoryConfig is the model for repo/project scopes configuration (rad.yaml) stored in a directory next to code.

Use LoadDirectoryConfig to load the configuration.

func LoadDirectoryConfig

func LoadDirectoryConfig(workingDirectory string) (*DirectoryConfig, error)

LoadDirectoryConfig uses the provided directory to find and load `.rad/rad.yaml`. The lookup will walk ^up^ the directory hierarchy looking for `.rad/rad.yaml` relative to the current directory, halting when it reaches git repo root (`.git`) or the filesystem root.

This scheme allows multiple applications to exist in the same git repo, but also prevents configuration from outside of a repo affecting the stuff inside.

type DirectoryWorkspaceConfig

type DirectoryWorkspaceConfig struct {
	// Application sets the current application name.
	Application string `yaml:"application,omitempty"`
}

DirectoryWorkspaceConfig contains settings that override settings on the workspace.

Jump to

Keyboard shortcuts

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