helpers

package
v0.0.0-...-7bac0ab Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version string
	SemVer  string
)

Functions

func FindProjectRoot

func FindProjectRoot() (string, error)

FindProjectRoot walks up the file tree to find the directory containing `go.mod`

func GetHTTPClient

func GetHTTPClient() *retryablehttp.Client

func InitHomeDirConfig

func InitHomeDirConfig(sess *session.Session, v *viper.Viper) error

func ParseHost

func ParseHost(arg string) (netip.Addr, error)

ParseHost attempts to convert the provided argument into a netip.Addr. If the argument isn't already an IP address, it is treated as a hostname and resolved using the system resolver.

func PrefixProjectRoot

func PrefixProjectRoot(prefix string) (string, error)

func TrackDuration

func TrackDuration(mu *sync.Mutex, m map[string]time.Duration, provider string) func()

TrackDuration returns a closure that records the duration since it was created in the supplied map using provider as the key. It is designed for use with defer when timing operations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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