parameters

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

type Parameter[T any] struct {
	// contains filtered or unexported fields
}

func Bool

func Bool(name, desc string) Parameter[bool]

func Bytes

func Bytes(name, desc string, defaults []byte) Parameter[[]byte]

func Duration

func Duration(name, desc string, defaults time.Duration) Parameter[time.Duration]

func Int

func Int(name, desc string, defaults int) Parameter[int]

func NewParameter

func NewParameter[T any](name, desc string, defaults T, parser Parser[T]) Parameter[T]

func String

func String(name, desc, defaults string) Parameter[string]

func (*Parameter[T]) Get

func (p *Parameter[T]) Get(params *Parameters) T

type Parameters

type Parameters struct {
	// contains filtered or unexported fields
}

func FromValues

func FromValues(values map[string]string) *Parameters

FromValues instantiates parameters with a cope of values.

func New

func New() *Parameters

New creates Parameters instance with default values.

func (*Parameters) Update

func (p *Parameters) Update(values map[string]string)

type Parser

type Parser[T any] func(string) (T, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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