config

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config implements loading the crossplane CLI config file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePath

func ResolvePath(flag string) string

ResolvePath returns the path to the config file, in priority order:

  1. flag - the value of the --config flag, if any.
  2. The CROSSPLANE_CONFIG environment variable.
  3. DefaultPath() (XDG/HOME-derived).

An empty string is returned only if no source produces one.

func Save

func Save(fs afero.Fs, path string, cfg *Config) error

Save writes cfg as YAML to path. It creates parent directories with mode 0o755 and writes the file with mode 0o600. An empty path is an error.

Types

type Config

type Config struct {
	// Version is the version of the config file.
	Version int `json:"version"`

	Features Features `json:"features,omitzero"`
}

Config is the on-disk configuration for the crossplane CLI.

func Load

func Load(fs afero.Fs, path string) (*Config, error)

Load reads a Config from path. A missing file is not an error; the zero Config is returned. Unknown fields in the file are an error so typos in flag names surface immediately.

type Features

type Features struct {
	EnableAlpha bool `json:"enableAlpha,omitempty"`
	DisableBeta bool `json:"disableBeta,omitempty"`
}

Features configures feature visibility.

Jump to

Keyboard shortcuts

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