cli

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cli holds what both commands share: environment defaults and logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Getenv

func Getenv(key, fallback string) string

Getenv returns the variable, or fallback when it is unset or empty.

func GetenvDuration

func GetenvDuration(key string, fallback time.Duration) (time.Duration, error)

GetenvDuration returns the variable parsed as a duration, or fallback when it is unset or empty.

func GetenvInt

func GetenvInt(key string, fallback int) (int, error)

GetenvInt returns the variable parsed as an integer, or fallback when it is unset or empty.

func NewLogger

func NewLogger(level string) (*slog.Logger, error)

NewLogger writes structured logs to stderr at the given level (debug, info, warn or error).

Types

This section is empty.

Jump to

Keyboard shortcuts

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