config

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPath is the default path for the configuration file
	DefaultPath = "PROJECT"

	// DefaultVersion is the version which will be used when the version flag is not provided
	DefaultVersion = config.Version2
)

Variables

This section is empty.

Functions

func Read

func Read() (*config.Config, error)

Read obtains the configuration from the default path but doesn't allow to persist changes

func ReadFrom

func ReadFrom(path string) (*config.Config, error)

ReadFrom obtains the configuration from the provided path but doesn't allow to persist changes

Types

type Config

type Config struct {
	config.Config
	// contains filtered or unexported fields
}

Config extends model/config.Config allowing to persist changes NOTE: the existence of Config structs in both model and internal packages is to guarantee that kubebuilder is the only project that can modify the file, while plugins can still receive the configuration

func Load

func Load() (*Config, error)

Load obtains the configuration from the default path allowing to persist changes (Save method)

func LoadFrom

func LoadFrom(path string) (*Config, error)

LoadFrom obtains the configuration from the provided path allowing to persist changes (Save method)

func New

func New(path string) *Config

New creates a new configuration that will be stored at the provided path

func (Config) Path

func (c Config) Path() string

Path returns the path for configuration file

func (Config) Save

func (c Config) Save() error

Save saves the configuration information

Jump to

Keyboard shortcuts

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