cmdsubst

package
v1.39.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 9 Imported by: 1 module, 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

Index

Constants

View Source
const SecretOrRandomPasswordCommandName string = "secretOrRandomPassword"

Variables

This section is empty.

Functions

func ContainsCommandInvocation

func ContainsCommandInvocation(doc, commandName string) bool

Returns true if the document 'doc' contains an invocation of a command.

func Eval

func Eval(ctx context.Context, input string, cmd CommandExecutor) (string, error)

Eval replaces all occurrences of bash-like command output substitution $(command arg1 arg2 ...) with the result provided by the command executor. Any error from the command executor will result in an error reported from Eval().

Types

type CommandExecutor

type CommandExecutor interface {
	// Returns true + replacement string if a command is recognized and runs successfully.
	// Returns false and no error if the command was not recognized by the executor, or in other "no-op" cases.
	Run(ctx context.Context, commandName string, args []string) (bool, string, error)
}

type SecretOrRandomPasswordCommandExecutor

type SecretOrRandomPasswordCommandExecutor struct {
	// contains filtered or unexported fields
}

func NewSecretOrRandomPasswordExecutor

func NewSecretOrRandomPasswordExecutor(
	keyvaultService keyvault.KeyVaultService, subscriptionId string) *SecretOrRandomPasswordCommandExecutor

func (*SecretOrRandomPasswordCommandExecutor) Run

func (e *SecretOrRandomPasswordCommandExecutor) Run(
	ctx context.Context,
	commandName string,
	args []string,
) (bool, string, error)

Jump to

Keyboard shortcuts

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