currency

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrencyKey = "currency"
)

Variables

View Source
var CurrencyKeyFn = contract.PathKeyFn(CurrencyKey)

Functions

func Idx

func Idx(p ...string) []contract.IndexEntry

func IdxSrch

func IdxSrch(p ...string) []contract.SearchIndexEntry

func Rules

Types

type Core

type Core struct {
	Currency *string `json:"currency" conform:"upper,trim" validate:"nnpt,nz,isocurrency"`
}

func ApplyCore

func ApplyCore(c *Core, modifiers ...CoreOption) Core

func (*Core) GetCurrency

func (c *Core) GetCurrency() string

func (*Core) SetCurrency

func (c *Core) SetCurrency(x string)

type CoreOption

type CoreOption = contracti.CoreOption[Core]

func WithCurrency

func WithCurrency(x string) CoreOption

type Currency

type Currency struct {
	Meta `bson:",inline" validate:"recurse"`
	Core `bson:",inline" validate:"recurse"`
}

Currency defines a three-letter ISO currency code.

func Mock

func Mock() *Currency

func New

func New(m Meta, cr Core) *Currency

type Meta

type Meta struct{}

func ApplyMeta

func ApplyMeta(m *Meta, modifiers ...MetaOption) Meta

type MetaOption

type MetaOption = contract.MetaOption[Meta]

Jump to

Keyboard shortcuts

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