flag

package
v0.0.0-...-67c52db Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "flag"

Name is the name registered for the flag codec.

Variables

View Source
var (
	DefaultRootName    = ""
	MapNamePlaceholder = "<name>"
)

Functions

func DecodeValues

func DecodeValues(msg proto.Message, values map[string]string) error

DecodeValues decode map into proto message.

func Parse

func Parse(args []string, element interface{}) (map[string]string, error)

Parse parses the command-line flag arguments into a map, using the type information in element to discriminate whether a flag is supposed to be a bool, and other such ambiguities.

Types

type Codec

type Codec struct{}

Codec is a Codec implementation with flag.

func (Codec) Marshal

func (Codec) Marshal(v interface{}) ([]byte, error)

func (Codec) Name

func (Codec) Name() string

func (Codec) Unmarshal

func (Codec) Unmarshal(data []byte, v interface{}) error

Jump to

Keyboard shortcuts

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