Help us shape the future of Go! Take the 2026 Go Developer Survey

helpers

package
v0.11.787 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSensorTimeout = 24 * time.Hour

Variables

This section is empty.

Functions

func CastResultToInteger

func CastResultToInteger(res [][]interface{}, tolerant bool) (int64, error)

func GetAllFilesInDir added in v0.11.123

func GetAllFilesInDir(fs afero.Fs, dir string) ([]string, error)

func GetExitCode added in v0.11.128

func GetExitCode(err error) int

func GetIngestrDestinationType added in v0.6.6

func GetIngestrDestinationType(asset *pipeline.Asset) (pipeline.AssetType, error)

func GetLatestFileInDir added in v0.11.123

func GetLatestFileInDir(fs afero.Fs, dir string) (string, error)

func GetPokeInterval added in v0.11.171

func GetPokeInterval(ctx context.Context, t *pipeline.Asset) int64

func GetSensorTimeout added in v0.11.558

func GetSensorTimeout(t *pipeline.Asset) time.Duration

GetSensorTimeout returns the configured sensor timeout for an asset, falling back to DefaultSensorTimeout when unset, invalid, or non-positive.

func ParseJSONOutputs added in v0.11.128

func ParseJSONOutputs(actual, expected string) (interface{}, interface{}, error)

func ParseSensorDuration added in v0.11.558

func ParseSensorDuration(raw string) (time.Duration, error)

ParseSensorDuration parses a single-unit duration string using the same suffix syntax as pipeline interval_modifiers (s, m, h, d, ms, ns). Combinators like "1h30m" are not supported; use "90m" instead. "M" (months) is rejected because a month is not a fixed time.Duration.

func PrefixGenerator

func PrefixGenerator() string

func ReadFile added in v0.11.128

func ReadFile(path string) string

func ReadJSONToFile added in v0.11.123

func ReadJSONToFile(fs afero.Fs, filename string, v interface{}) error

func TrimToLength added in v0.11.171

func TrimToLength(s string, maxLength int) string

func WriteJSONToFile added in v0.11.122

func WriteJSONToFile(fs afero.Fs, data interface{}, filename string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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