utils

package
v1.40.6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetEnvProviderFunc func() EnvProvider

Functions

func GetExecStatus

func GetExecStatus(err error) int

func GetPreviousVersion

func GetPreviousVersion(resp []byte) (string, error)

GetPreviousVersion tries to extract the version property in a JSON response and return the previous version that must be a non-negative integer.

func IndexOf

func IndexOf(slice []string, target string) int

func ParseHours

func ParseHours(s string) (int, error)

ParseHours returns the number of hours given a string that can represent either an integer (denoting hours) or an integer with a time-unit specifier.

func StringToSlice

func StringToSlice(str string) []string

StringToSlice converts a string with comma-separated elements to a slice. It first excludes a leading or trailing bracket character if present in the string.

Types

type EnvFunc

type EnvFunc func() string

func (EnvFunc) GetHomeDir

func (f EnvFunc) GetHomeDir() string

func (EnvFunc) GetOs

func (f EnvFunc) GetOs() string

type EnvProvider

type EnvProvider interface {
	GetOs() string
	GetHomeDir() string
}

func NewEnvProvider

func NewEnvProvider() EnvProvider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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