utils

package
v0.0.0-...-3af58a9 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PointerTo

func PointerTo[T any](value T) *T

PointerTo returns a pointer to a given value.

func ToDuration

func ToDuration(ctx context.Context, d *transform.TransformData) (any, error)

func ToJSON

func ToJSON(v any) string

ToJSON dumps the input object to JSON.

func ToPrettyJSON

func ToPrettyJSON(v any) string

ToPrettyJSON dumps the input object to JSON.

func ToYAML

func ToYAML(v any) string

ToYAML dumps the input object to YAML.

Types

type Duration

type Duration time.Duration

Duration represents a duration in human-readable format

func (Duration) MarshalJSON

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

func (*Duration) String

func (d *Duration) String() string

func (*Duration) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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