util

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllUnique added in v0.1.2

func AllUnique[T comparable](sl []T) bool

AllUnique returns true if all elements in the given slice are unique.

func DecodeOptions

func DecodeOptions(in io.ReadCloser, formatHint string, out any) error

DecodeOptions will attempt to decode the given reader into the given object. The formatHint is used to select the format of the document. If the formatHint is empty, the format is guessed from the document. The document is first treated as a go-template with some custom functions. This allows us to use environment variables and file contents in the config.

func Exec

func Exec(ctx context.Context, command string, args ...string) error

Exec executes a command with context.

func ExecOutput

func ExecOutput(ctx context.Context, command string, args ...string) ([]byte, error)

ExecOutput executes a command with context and returns the output.

func Pointer

func Pointer[T any](t T) *T

Pointer returns a pointer to the given value.

func PrettyByteSize added in v0.1.2

func PrettyByteSize(b int64) string

PrettyByteSize returns a human-readable string of the given byte size.

Types

This section is empty.

Directories

Path Synopsis
Package crypto contains cryptographic utilities.
Package crypto contains cryptographic utilities.
package netutil provides common utility functions for networking.
package netutil provides common utility functions for networking.

Jump to

Keyboard shortcuts

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