config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config implements "semaphore-cli config validate" and "semaphore-cli config print --effective": thin commands over the strict loader of the version 2 bootstrap file (cmd/relayproxy/bootstrap).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelpVars

func HelpVars() kong.Vars

HelpVars returns the kong interpolation variables used by Cmd help tags.

func Run

func Run(args []string, streams *helper.Streams, deps Deps) error

Run parses args against the config command tree and executes the selected subcommand with injected streams and deps. Running without a subcommand prints config help to streams.Stdout and returns nil.

Types

type Cmd

type Cmd struct {
	Output   string      `default:"text" help:"${helpConfigOutput}"   name:"output" short:"o"`
	Validate ValidateCmd `cmd:""         help:"${helpConfigValidate}"`
	Print    PrintCmd    `cmd:""         help:"${helpConfigPrint}"`
}

Cmd is the kong command group for validating and printing the version 2 bootstrap file of the relay proxy.

type Deps

type Deps struct {
	// LookupEnv reads an environment variable: the SEMAPHORE_* overrides apply to the effective configuration.
	LookupEnv func(string) (string, bool)
	// ReadFile reads the bootstrap file.
	ReadFile func(string) ([]byte, error)
}

Deps are the parts of the outside world that the commands use.

func DefaultDeps

func DefaultDeps() Deps

DefaultDeps returns the dependencies of the real command.

type PrintCmd

type PrintCmd struct {
	File      string `arg:""                                              help:"Bootstrap file to print." name:"file"`
	Effective bool   `help:"print the effective configuration (required)" name:"effective"`
}

PrintCmd prints the effective bootstrap configuration with defaults and environment overrides applied.

func (PrintCmd) Help

func (PrintCmd) Help() string

Help returns the detailed description of config print for kong's help output.

func (PrintCmd) Run

func (p PrintCmd) Run(parent *Cmd, streams *helper.Streams, deps *Deps) error

Run prints the effective bootstrap file to streams.Stdout.

type ValidateCmd

type ValidateCmd struct {
	File string `arg:"" help:"Bootstrap file to check." name:"file"`
}

ValidateCmd checks a bootstrap file with the loader of the relay proxy.

func (ValidateCmd) Help

func (ValidateCmd) Help() string

Help returns the detailed description of config validate for kong's help output.

func (ValidateCmd) Run

func (v ValidateCmd) Run(parent *Cmd, streams *helper.Streams, deps *Deps) error

Run validates the bootstrap file and writes the result to streams.Stdout.

Jump to

Keyboard shortcuts

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