zeusutils

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package zeusutils provides utilities for use in zeus commands that are implemented in Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadArg

func LoadArg(name string) string

LoadArg attempts to load the named zeus argument from os.Args. Args are passed to zeus commands in the name=value format on the commandline. Zeus will throw an error if not all required args are provided to your command, so this util does not validate the presence of args, but only loads the value. In addition, leading and trailing whitespace will be trimmed.

func LoadArgs added in v0.9.14

func LoadArgs() map[string]string

LoadArgs loads all zeus arguments into a map, with the argument label as keys.

func Prompt added in v0.9.14

func Prompt(name string) string

Prompt asks the user to provide input for the value with the given name, and returns the raw value to the caller.

func RequireEnv

func RequireEnv(name string) string

RequireEnv attempts to load the value of the named environment variable If no value for the given name has been found, the program will fatal.

func TrimStringLiterals added in v0.9.14

func TrimStringLiterals(value string) string

TrimStringLiterals will remove string literals, if the provided string starts AND ends with a literal. Eg: "value" => value 'value' => value "value => "value

Types

This section is empty.

Jump to

Keyboard shortcuts

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