utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Build string
	Major string
	Minor string
	Patch string

	CLIVersion Version
)

Functions

func EnumCheck added in v0.1.17

func EnumCheck(cmd *cobra.Command, flag string, allowed []string)

EnumCheck validates that a changed string flag holds one of the allowed values.

func IntPtrOrNil

func IntPtrOrNil(i int) *int

func JSONValue added in v0.1.17

func JSONValue(raw, flag string) any

JSONValue parses a JSON-string flag value into a generic value.

func StringArrayToIntArray

func StringArrayToIntArray(strArr []string) []int

func StringPtrOrNil

func StringPtrOrNil(s string) *string

func StringToInt

func StringToInt(s string) int

func StringToTime

func StringToTime(dateStr string) time.Time

Types

type Version added in v0.1.0

type Version struct {
	Major, Minor, Patch int
	Build               string
}

func (Version) String added in v0.1.0

func (v Version) String(withBuild bool) string

Jump to

Keyboard shortcuts

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