args

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package args contains shared utility methods for argument parsing and validation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CIDRList

type CIDRList struct {
	StringList StringList
	CIDRList   []net.IPNet
}

CIDRList implements the flag.Value interface and allows to parse stringified lists in the form: "val1,val2".

func (*CIDRList) Set

func (cl *CIDRList) Set(str string) error

Set parses the provided string into the []string list.

func (*CIDRList) String

func (cl *CIDRList) String() string

String returns the stringified list.

func (CIDRList) Type

func (cl CIDRList) Type() string

Type returns the cidrList type.

type Percentage

type Percentage struct {
	Val uint64
}

Percentage implements the flag.Value interface and allows to parse stringified percentages.

func (*Percentage) Set

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

Set parses the provided string into the percentage.

func (Percentage) String

func (p Percentage) String() string

String returns the stringified percentage.

func (Percentage) Type

func (p Percentage) Type() string

Type returns the percentage type.

type StringList

type StringList struct {
	StringList []string
}

StringList implements the flag.Value interface and allows to parse stringified lists in the form: "val1,val2".

func (*StringList) Set

func (sl *StringList) Set(str string) error

Set parses the provided string into the []string list.

func (StringList) String

func (sl StringList) String() string

String returns the stringified list.

func (StringList) Type

func (sl StringList) Type() string

Type returns the stringList type.

type StringMap

type StringMap struct {
	StringMap map[string]string
}

StringMap implements the flag.Value interface and allows to parse stringified maps in the form: "key1=val1,key2=val2".

func (*StringMap) Set

func (sm *StringMap) Set(str string) error

Set parses the provided string into the map[string]string map.

func (StringMap) String

func (sm StringMap) String() string

String returns the stringified map.

func (StringMap) Type

func (sm StringMap) Type() string

Type returns the stringMap type.

Jump to

Keyboard shortcuts

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