config

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContextOverride string
)

Functions

func FindWorkspaceFile added in v0.2.4

func FindWorkspaceFile(dir string) (root string)

modified from the go source code: src/cmd/go/internal/modload/init.go

func SetContext added in v0.2.0

func SetContext(new Context)

func SetDefaultContext added in v0.2.0

func SetDefaultContext(new string) error

Types

type API added in v0.0.3

type API struct {
	ImageName string `mapstructure:"image_name" yaml:"image_name"`
}

type Config

type Config struct {
	Default  string
	Contexts map[string]Context
}

func Get

func Get() Config

type Context added in v0.2.0

type Context struct {
	Name        string
	Repo        string
	Root        string
	TrunkBranch string `mapstructure:"trunk_branch" yaml:"trunk_branch"`
	API         API    `mapstructure:"api"  yaml:"api"`
	IsWorkspace bool
	Infra       map[string]InfraService
}

func GetContext added in v0.2.0

func GetContext() Context

GetContext will return the current context or exit if none is found. You can call this function multiple times in a single command execution and it will only process context lookup logic once and then return the found context every subsequent call. The current context is found using the following precedence:

1. Currently set in-memory context (singleton)

2. The context override set by the user using the --context flag

3. The context of the current (or any parent) directory

4. The default context as set in the dctl config

func LoadWorkspaceContext added in v0.2.0

func LoadWorkspaceContext(path string) Context

type InfraService added in v0.2.4

type InfraService struct {
	ImageName string `mapstructure:"image_name" yaml:"image_name"`
}

Jump to

Keyboard shortcuts

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