util

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotNoArgs  = errors.New("no arg is accepted")
	ErrNotOneArgs = errors.New("only one arg is accepted")
	ErrNotTwoArgs = errors.New("only two args are accepted")
	ErrEmptyItem  = errors.New("empty config item name")
	ErrEmptyValue = errors.New("empty config item value")
)

Functions

func GetItemFromArgs

func GetItemFromArgs(args []string) (string, error)

GetItemFromArgs returns config item name specified by args.

func GetItemValueFromArgs

func GetItemValueFromArgs(args []string) (string, string, error)

GetItemValueFromArgs returns config item name and value specified by args.

func ValidateItem

func ValidateItem(item string) error

ValidateItem returns the config item name is valid or not.

func ValidateNoArg

func ValidateNoArg(args []string) error

ValidateNoArg returns true if there is no arg.

func ValidateValue

func ValidateValue(value string) error

ValidateValue returns the config item value is valid or not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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