flags

package
v0.0.0-...-7f81a18 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package flags provide a global flags cache and extends types of flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(name string, defaultValue bool, usage string) *bool

Bool binds flag with bool type.

func Duration

func Duration(name string, defaultValue time.Duration, usage string) *time.Duration

Duration binds flag with time.Duration type.

func Float64

func Float64(name string, defaultValue float64, usage string) *float64

Float64 binds flag with float64 type.

func Int

func Int(name string, defaultValue int, usage string) *int

Int binds flag with int type.

func ReadFile

func ReadFile(name, path, usage string) **os.File

ReadFile binds flag with *os.File type. It will check the existent of file.

func Slice

func Slice(name string, defaultValue []string, usage string) *[]string

Slice binds flag with slice type.

func String

func String(name string, defaultValue string, usage string) *string

String binds flag with string type.

func ValidateNonZero

func ValidateNonZero(names ...string) error

ValidateNonZero checks the flags non-zero after parsing.

func Var

func Var(value flag.Value, name string, usage string)

Var binds flag with custom value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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