templatefunctions

package
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DateTimeFormatFromIso

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

DateTimeFormatFromIso template helper function

func (*DateTimeFormatFromIso) Func

func (tf *DateTimeFormatFromIso) Func(context.Context) interface{}

Func template function factory

func (*DateTimeFormatFromIso) Inject

func (tf *DateTimeFormatFromIso) Inject(service *application.DateTimeService, logger flamingo.Logger)

Inject dependencies

type DateTimeFormatFromTime

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

DateTimeFormatFromTime template helper function

func (*DateTimeFormatFromTime) Func

func (tf *DateTimeFormatFromTime) Func(context.Context) interface{}

Func template function factory

func (*DateTimeFormatFromTime) Inject

func (tf *DateTimeFormatFromTime) Inject(service *application.DateTimeService, logger flamingo.Logger)

Inject dependencies

type LabelFunc added in v3.2.2

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

LabelFunc is exported as a template function

func (*LabelFunc) Func added in v3.2.2

func (tf *LabelFunc) Func(context.Context) interface{}

Func template function factory

func (*LabelFunc) Inject added in v3.2.2

func (tf *LabelFunc) Inject(labelService *application.LabelService, logger flamingo.Logger)

Inject dependencies

type NumberFormatFunc

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

NumberFormatFunc for formatting numbers

func (*NumberFormatFunc) Func

func (nff *NumberFormatFunc) Func(context.Context) interface{}

Func returns the template function for formatting numbers

func (*NumberFormatFunc) Inject

func (nff *NumberFormatFunc) Inject(
	logger flamingo.Logger,
	config *struct {
		Precision float64 `inject:"config:core.locale.numbers.precision"`
		Decimal   string  `inject:"config:core.locale.numbers.decimal"`
		Thousand  string  `inject:"config:core.locale.numbers.thousand"`
	},
)

Inject dependencies

type PriceFormatFunc

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

PriceFormatFunc for formatting prices

func (*PriceFormatFunc) Func

func (pff *PriceFormatFunc) Func(context.Context) interface{}

Func formats the value and adds currency sign/symbol example output could be: $ 21,500.99

func (*PriceFormatFunc) Inject

func (pff *PriceFormatFunc) Inject(priceService *application.PriceService)

Inject dependencies

type PriceFormatLongFunc

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

PriceFormatLongFunc for formatting prices with additional currency code/label

func (*PriceFormatLongFunc) Func

func (pff *PriceFormatLongFunc) Func(ctx context.Context) interface{}

Func formats the value, adds currency sign/symbol and add an additional currency code/label example output could be: $ 21,500.99 USD

func (*PriceFormatLongFunc) Inject

func (pff *PriceFormatLongFunc) Inject(
	labelService *application.LabelService,
	formatFunc *PriceFormatFunc,
	priceService *application.PriceService,
	config *struct {
		Config config.Map `inject:"config:core.locale.accounting"`
	},
)

Inject dependencies

Jump to

Keyboard shortcuts

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