utils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env() types.EnvVars

func HandleError

func HandleError(ctx context.Context, err error)

func LoadEnv

func LoadEnv(envs ...EnvLoader) error

func SafeClose

func SafeClose(ctx context.Context, c Closer)

func SafeWrite

func SafeWrite(ctx context.Context, w io.Writer, b []byte)

func ToAny added in v0.2.2

func ToAny(input any) (any, error)

func ToPtrSlice

func ToPtrSlice[T any](x []T) []*T

Types

type Closer

type Closer interface {
	Close() error
}

type EnvLoader

type EnvLoader func() error

func EnvDef

func EnvDef(key string, dst *string) EnvLoader

Jump to

Keyboard shortcuts

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