utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 10 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(c Closer)

func SafeWrite

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

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