utils

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToStruct

func AnyToStruct[O any](input any) (*O, error)

func LookupExecutable

func LookupExecutable(ctx context.Context, candidates []string) (string, error)

LookupExecutable returns the first executable path found for the given candidates.

func ToPointer

func ToPointer[T any](v T) *T

Types

type Duration

type Duration time.Duration

Duration is a new type based on time.Duration that allows for marshalling/unmarshalling to/from a human-readable string format (e.g., "1h30m").

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. This implementation can unmarshal both the numeric (nanoseconds) and string formats.

Jump to

Keyboard shortcuts

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