flags

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package flags is a wrapper for the default flag package. All types and functions allow checking if a flag was set.

Example:

flags.Bool("local", false, "")

flag.Parse()

flag.Lookup("local").Value.(*flags.IntType).IsSet()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(name string, value bool, usage string)

Bool defines a bool flag with specified name, default value, and usage string.

func Database

func Database(name string, value database.Database, usage string)

Bool defines a database flag with specified name, default value, and usage string.

func Float64

func Float64(name string, value float64, usage string)

Float64 defines a float64 flag with specified name, default value, and usage string.

func Int

func Int(name string, value int, usage string)

Int defines a int flag with specified name, default value, and usage string.

func Int64

func Int64(name string, value int64, usage string)

Int64 defines a int64 flag with specified name, default value, and usage string.

func String

func String(name string, value string, usage string)

String defines a string flag with specified name, default value, and usage string.

func Uint

func Uint(name string, value uint, usage string)

Uint defines a uint flag with specified name, default value, and usage string.

func Uint64

func Uint64(name string, value uint64, usage string)

Uint64 defines a uint64 flag with specified name, default value, and usage string.

Types

type BoolValue

type BoolValue struct {
	// contains filtered or unexported fields
}

func (*BoolValue) Get

func (b *BoolValue) Get() interface{}

func (*BoolValue) IsBoolFlag

func (b *BoolValue) IsBoolFlag() bool

func (*BoolValue) IsSet

func (b *BoolValue) IsSet() bool

func (*BoolValue) Set

func (b *BoolValue) Set(s string) error

func (*BoolValue) String

func (b *BoolValue) String() string

type DatabaseValue

type DatabaseValue struct {
	// contains filtered or unexported fields
}

func (*DatabaseValue) Get

func (db *DatabaseValue) Get() interface{}

func (*DatabaseValue) IsSet

func (db *DatabaseValue) IsSet() bool

func (*DatabaseValue) Set

func (db *DatabaseValue) Set(s string) error

func (*DatabaseValue) String

func (db *DatabaseValue) String() string

type Float64Value

type Float64Value struct {
	// contains filtered or unexported fields
}

func (*Float64Value) Get

func (f *Float64Value) Get() interface{}

func (*Float64Value) IsSet

func (f *Float64Value) IsSet() bool

func (*Float64Value) Set

func (f *Float64Value) Set(s string) error

func (*Float64Value) String

func (f *Float64Value) String() string

type Int64Value

type Int64Value struct {
	// contains filtered or unexported fields
}

func (*Int64Value) Get

func (i *Int64Value) Get() interface{}

func (*Int64Value) IsSet

func (i *Int64Value) IsSet() bool

func (*Int64Value) Set

func (i *Int64Value) Set(s string) error

func (*Int64Value) String

func (i *Int64Value) String() string

type IntValue

type IntValue struct {
	// contains filtered or unexported fields
}

func (*IntValue) Get

func (i *IntValue) Get() interface{}

func (*IntValue) IsSet

func (i *IntValue) IsSet() bool

func (*IntValue) Set

func (i *IntValue) Set(s string) error

func (*IntValue) String

func (i *IntValue) String() string

type StringValue

type StringValue struct {
	// contains filtered or unexported fields
}

func (StringValue) Get

func (s StringValue) Get() interface{}

func (StringValue) IsSet

func (s StringValue) IsSet() bool

func (*StringValue) Set

func (s *StringValue) Set(val string) error

func (StringValue) String

func (s StringValue) String() string

type Uint64Value

type Uint64Value struct {
	// contains filtered or unexported fields
}

func (*Uint64Value) Get

func (i *Uint64Value) Get() interface{}

func (*Uint64Value) IsSet

func (i *Uint64Value) IsSet() bool

func (*Uint64Value) Set

func (i *Uint64Value) Set(s string) error

func (*Uint64Value) String

func (i *Uint64Value) String() string

type UintValue

type UintValue struct {
	// contains filtered or unexported fields
}

func (*UintValue) Get

func (i *UintValue) Get() interface{}

func (*UintValue) IsSet

func (i *UintValue) IsSet() bool

func (*UintValue) Set

func (i *UintValue) Set(s string) error

func (*UintValue) String

func (i *UintValue) String() string

Jump to

Keyboard shortcuts

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