config

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultClientID = "builder-cli"

DefaultClientID is the default client ID using the PKCE flow.

View Source
const (
	// UnknownCwd is the unknown current working directory.
	UnknownCwd = ""
)

Variables

View Source
var DefaultConfig = New()

DefaultConfig is the default configuration.

Functions

func ExpandConfigPath added in v0.3.5

func ExpandConfigPath(path string) (string, error)

ExpandConfigPath expands the config path and creates the store folder.

Types

type AuthFlags

type AuthFlags struct {
	// ClientID is the client ID for the OIDC provider.
	ClientID string `envconfig:"CLIENT_ID" default:"builder-cli"`
	// ClientURL is the URL of the OIDC provider.
	ClientURL string `envconfig:"CLIENT_URL" default:"http://builder.internal:5556/dex"`
}

AuthFlags contains the flags for the authentication.

type Config

type Config struct {
	URL      string
	Flags    Flags
	Store    string
	Stdin    *os.File
	Stdout   *os.File
	Stderr   *os.File
	Spec     *specs.Spec
	File     string
	Path     string
	FileMode os.FileMode
	Verbose  bool
	Task     TaskFlags
}

Config contains the configuration.

func New

func New() Config

New returns a new config.

func (*Config) Cwd

func (c *Config) Cwd() (string, error)

Cwd return the current working directory. Which is the path in which the builder spec is located.

func (*Config) HomeDir

func (c *Config) HomeDir() (string, error)

HomeDir returns the home directory.

func (*Config) InitDefaultConfig

func (c *Config) InitDefaultConfig() error

InitDefaultConfig initializes the default configuration.

func (*Config) LoadSpec

func (c *Config) LoadSpec() error

LoadSpec is a helper to load the spec from the config file.

func (*Config) Vars

func (c *Config) Vars() []string

Vars returns the variables.

type Flags

type Flags struct {
	// Plugins contains the plugins to use.
	Plugins []string
	// Vars contains the variables to use.
	Vars []string
	// Dry indicates whether to print dry run messages.
	Dry bool
	// Force indicates whether to force overwrite.
	Force bool
	// Root is the root directory of the project.
	Root bool
	// Verbose indicates whether to print verbose messages.
	Verbose bool
	// Version indicates whether to print version.
	Version bool
	// TaskFlags contains the flags for a task.
	TaskFlags TaskFlags
	// AuthFlags contains the flags for the authentication.
	AuthFlags AuthFlags
}

Flags contains the command line flags.

func NewFlags

func NewFlags() Flags

NewFlags returns a new flags.

type TaskFlags

type TaskFlags struct {
	// Name is the name of the task to execute.
	Name string
}

TaskFlags contains the flags for a task.

Jump to

Keyboard shortcuts

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