arg

package
v0.0.0-...-9129f25 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Key   string
	Value interface{}
}

Arg defaults argument.

func (Arg) String

func (a Arg) String() string

String arg to string.

func (Arg) Val

func (a Arg) Val() interface{}

Val gets valuet argument.

type Currency

type Currency struct {
	Key    string
	Value  interface{}
	Format FormatCurrency
	// ISO 3-letter ISO 4217
	ISO string
}

Currency argument.

func (Currency) String

func (a Currency) String() string

String gets string from currency.

func (Currency) Val

func (a Currency) Val() interface{}

Val gets value currency.

type CurrencyOption

type CurrencyOption func(*Currency)

CurrencyOption configures option.

func WithCurrencyFormat

func WithCurrencyFormat(format FormatCurrency) CurrencyOption

WithCurrencyFormat sets format currency.

func WithCurrencyISO

func WithCurrencyISO(iso string) CurrencyOption

WithCurrencyISO sets ISO 4217 code currecy.

type FormatCurrency

type FormatCurrency int

FormatCurrency types format.

const (
	CurrencyFormatSymbol FormatCurrency = iota + 1
	CurrencyFormatISO
	CurrencyFormatNarrowSymbol
)

Currency format.

type FormatNumber

type FormatNumber int

FormatNumber format number.

const (
	NumberFormatDecimal FormatNumber = iota + 1
	NumberFormatPercent
	NumberFormatPerMille
	NumberFormatEngineering
	NumberFormatScientific
)

format argument.

type Number

type Number struct {
	Key    string
	Value  interface{}
	Format FormatNumber
}

Number argument.

func (Number) Configure

func (n Number) Configure(opts ...NumberOption) Number

Configure number.

func (Number) String

func (n Number) String() string

String number to string.

func (Number) Val

func (n Number) Val() interface{}

Val gets number value.

type NumberOption

type NumberOption func(*Number)

NumberOption configure number argument.

func WithNumberFormat

func WithNumberFormat(format FormatNumber) NumberOption

WithNumberFormat sets format number.

Jump to

Keyboard shortcuts

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