translation: gitoa.ru/go-4devs/translation/arg Index | Files

package arg

import "gitoa.ru/go-4devs/translation/arg"

Index

Package Files

arg.go currency.go number.go

type Arg Uses

type Arg struct {
    Key   string
    Value interface{}
}

Arg defaults argument.

func (Arg) String Uses

func (a Arg) String() string

String arg to string.

func (Arg) Val Uses

func (a Arg) Val() interface{}

Val gets valuet argument.

type Currency Uses

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

Currency argument.

func (Currency) String Uses

func (a Currency) String() string

String gets string from currency.

func (Currency) Val Uses

func (a Currency) Val() interface{}

Val gets value currency.

type CurrencyOption Uses

type CurrencyOption func(*Currency)

CurrencyOption configures option.

func WithCurrencyFormat Uses

func WithCurrencyFormat(format FormatCurrency) CurrencyOption

WithCurrencyFormat sets format currency.

func WithCurrencyISO Uses

func WithCurrencyISO(iso string) CurrencyOption

WithCurrencyISO sets ISO 4217 code currecy.

type FormatCurrency Uses

type FormatCurrency int

FormatCurrency types format.

const (
    CurrencyFormat FormatCurrency = iota
    CurrencyFormatSymbol
    CurrencyFormatISO
    CurrencyFormatNarrowSymbol
)

Currency format.

type FormatNumber Uses

type FormatNumber int

FormatNumber format number.

const (
    NumberFormatUndefined FormatNumber = iota
    NumberFormatDecimal
    NumberFormatPercent
    NumberFormatPerMille
    NumberFormatEngineering
    NumberFormatScientific
)

format argument.

type Number Uses

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

Number argument.

func (Number) Configure Uses

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

Configure number.

func (Number) String Uses

func (n Number) String() string

String number to string.

func (Number) Val Uses

func (n Number) Val() interface{}

Val gets number value.

type NumberOption Uses

type NumberOption func(*Number)

NumberOption configure number argument.

func WithNumberFormat Uses

func WithNumberFormat(format FormatNumber) NumberOption

WithNumberFormat sets format number.

Package arg imports 1 packages (graph) and is imported by 2 packages. Updated 2020-05-20. Refresh now. Tools for package owners.