params

package
v1.7.12 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package params provides implementation of Go API for argument parser

Package params provides implementation of Go API for argument parser

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data interface {
	ConfigFilePath() string
	ShowVersion() bool
}

Data is an interface to get the configuration path and flag.

type Option

type Option func(*parser)

func WithConfigFileDescription

func WithConfigFileDescription(desc string) Option

WithConfigFileDescription returns Option that sets filePath.description.

func WithConfigFilePathDefault

func WithConfigFilePathDefault(path string) Option

WithConfigFilePathDefault returns Option that sets filePath.defaultPath.

func WithConfigFilePathKeys

func WithConfigFilePathKeys(keys ...string) Option

WithConfigFilePathKeys returns Option that sets filePath.keys.

func WithVersionDescription

func WithVersionDescription(desc string) Option

WithVersionDescription returns Option that sets version.description.

func WithVersionFlagDefault

func WithVersionFlagDefault(flag bool) Option

WithVersionFlagDefault returns Option that sets version.defaultFlag.

func WithVersionKeys

func WithVersionKeys(keys ...string) Option

WithVersionKeys returns Option that sets version.keys.

type Parser added in v1.7.0

type Parser interface {
	Parse() (Data, bool, error)
}

Parser is an interface to parse commnad-line argument.

func New

func New(opts ...Option) Parser

New returns parser object.

Jump to

Keyboard shortcuts

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