flags

package
v0.0.0-...-c9cfaf6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package flags provides custom flag value types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Param

type Param struct {
	Key   string
	Value string
}

Param is a key-value pair.

type Params

type Params []Param

Params is a collection of key value pairs. Satisfies the flag.Value interface.

func ParseParams

func ParseParams(s string) (Params, error)

ParseParams parses a string into a key-value pair map. Expects a comma-separated list of key-value pairs, for example:

a=1,b=2,c=3

func (Params) Map

func (p Params) Map() map[string]string

func (*Params) Set

func (p *Params) Set(s string) error

func (Params) String

func (p Params) String() string

type Strings

type Strings []string

Strings is a list of strings satisfying the flag.Value interface.

func (*Strings) Set

func (a *Strings) Set(s string) error

Set splits the comma-separated string s.

func (Strings) String

func (a Strings) String() string

type TypeParams

type TypeParams struct {
	Type   string
	Params Params
}

TypeParams is a concise configuration of some object, with a type and parameters. Satisfies the flag.Value interface.

func ParseTypeParams

func ParseTypeParams(s string) (*TypeParams, error)

ParseTypeParams parses a string into type and parameters. For example:

type:a=1,b=2,c=3

func (*TypeParams) Set

func (t *TypeParams) Set(s string) error

func (*TypeParams) String

func (t *TypeParams) String() string

Jump to

Keyboard shortcuts

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