envflag

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(fs *pflag.FlagSet, name, envKey string) (bool, error)

Bool returns a bool from flag/env/default.

func Duration

func Duration(fs *pflag.FlagSet, name, envKey string) (time.Duration, error)

Duration returns a duration from flag/env/default.

func HostPort

func HostPort(fs *pflag.FlagSet, name, envKey string) (string, error)

HostPort parses host:port from flag/env/default.

func Int

func Int(fs *pflag.FlagSet, name, envKey string) (int, error)

Int returns an int from flag/env/default.

func SchemaHostPort

func SchemaHostPort(fs *pflag.FlagSet, name, envKey string) (string, error)

SchemaHostPort parses schema://host:port from flag/env/default.

func String

func String(fs *pflag.FlagSet, name, envKey string) (string, error)

String returns a trimmed string from flag/env/default.

func URL

func URL(fs *pflag.FlagSet, name, envKey string) (string, error)

URL validates a full URL with scheme and hostname.

Types

This section is empty.

Jump to

Keyboard shortcuts

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