types

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSV added in v1.6.6

type CSV string

CSV is a string with comma-separated values.

func (*CSV) Set added in v1.6.6

func (csv *CSV) Set(v string) error

Set sets the value.

func (*CSV) String added in v1.6.6

func (csv *CSV) String() string

func (*CSV) Type added in v1.6.6

func (csv *CSV) Type() string

Type returns a description of the CSV type.

func (*CSV) Values added in v1.6.6

func (csv *CSV) Values() []string

Values returns the values as a slice

type OnOff

type OnOff string

OnOff represents a setting that is on (true) or off (false) or undefined.

func NewOnOff

func NewOnOff(b bool) OnOff

NewOnOff converts a bool to the values "on" (true) or "off" (false).

func (*OnOff) Bool

func (flag *OnOff) Bool() bool

Bool returns true if the flag valye is "on", otherwise it returns false.

func (*OnOff) Set

func (flag *OnOff) Set(v string) error

Set converts a string to the value "on" or "off" or returns an error if the value cannot be converted. For example, both "on" and "true" will set the flag to the value "on".

func (*OnOff) String

func (flag *OnOff) String() string

func (*OnOff) Type

func (flag *OnOff) Type() string

Type returns a description of the OnOff type.

type Percentage

type Percentage string

Percentage represents a percentage.

func (*Percentage) Int

func (p *Percentage) Int() int

Int returns the integer part of a percentage.

func (*Percentage) Set

func (p *Percentage) Set(v string) error

Set will update the value of a percentage type if the value can be parsed as a float, otherwise an error is returned.

func (*Percentage) String

func (p *Percentage) String() string

func (*Percentage) Type

func (p *Percentage) Type() string

Type returns a desccription of the percentage type.

Jump to

Keyboard shortcuts

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