application

package
v3.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DateTimeService

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

DateTimeService is a basic support service for date/time parsing

func (*DateTimeService) GetDateTimeFormatter

func (dts *DateTimeService) GetDateTimeFormatter(timeValue time.Time) (*domain.DateTimeFormatter, error)

GetDateTimeFormatter from time

func (*DateTimeService) GetDateTimeFormatterFromIsoString

func (dts *DateTimeService) GetDateTimeFormatterFromIsoString(dateTimeString string) (*domain.DateTimeFormatter, error)

GetDateTimeFormatterFromIsoString Need string in format ISO: "2017-11-25T06:30:00Z"

func (*DateTimeService) Inject

func (dts *DateTimeService) Inject(
	logger flamingo.Logger,
	config *struct {
		DateFormat     string `inject:"config:core.locale.date.dateFormat"`
		TimeFormat     string `inject:"config:core.locale.date.timeFormat"`
		DateTimeFormat string `inject:"config:core.locale.date.dateTimeFormat"`
		Location       string `inject:"config:core.locale.date.location"`
	},
)

Inject dependencies

type DateTimeServiceInterface

type DateTimeServiceInterface interface {
	GetDateTimeFormatterFromIsoString(dateTimeString string) (*domain.DateTimeFormatter, error)
	GetDateTimeFormatter(dateTime time.Time) (*domain.DateTimeFormatter, error)
}

DateTimeServiceInterface to define a service to obtain formatted date time data

type LabelService

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

LabelService for translatable labels

func (*LabelService) AllLabels added in v3.1.0

func (l *LabelService) AllLabels() []domain.Label

AllLabels return a array of all labels

func (*LabelService) Inject

func (l *LabelService) Inject(labelProvider labelProvider, translationService domain.TranslationService, logger flamingo.Logger, config *struct {
	DefaultLocaleCode string       `inject:"config:core.locale.locale"`
	FallbackLocalCode config.Slice `inject:"config:core.locale.fallbackLocales,optional"`
})

Inject dependencies

func (*LabelService) NewLabel

func (l *LabelService) NewLabel(key string) *domain.Label

NewLabel factory

type PriceFormatConfig added in v3.2.2

type PriceFormatConfig struct {
	Decimal    string `json:"decimal"`
	Thousand   string `json:"thousand"`
	FormatZero string `json:"formatZero"`
	FormatLong string `json:"formatLong"`
	Format     string `json:"format"`
}

PriceFormatConfig represents price formatting configuration which is possible to specify.

type PriceService

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

PriceService for formatting prices

func (*PriceService) FormatPrice

func (s *PriceService) FormatPrice(value float64, currency string) string

FormatPrice by price

func (*PriceService) GetConfigForCurrency added in v3.0.4

func (s *PriceService) GetConfigForCurrency(currency string) PriceFormatConfig

GetConfigForCurrency get configuration for currency

func (*PriceService) Inject

func (s *PriceService) Inject(labelService *LabelService, logger flamingo.Logger, 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