currencypkg

package
v0.0.0-...-e6e2e8d Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package currencypkg provides common currency related functionality for apps.

Index

Constants

View Source
const (
	USD = "USD"
	EUR = "EUR"
	RMB = "RMB"
)

Constants for all supported currencies.

Variables

View Source
var SupportedCurrencies = []string{
	USD,
	EUR,
	RMB,
}

SupportedCurrencies holds all the supported currencies.

View Source
var ValidCurrency validator.Func = func(fl validator.FieldLevel) bool {
	if c, ok := fl.Field().Interface().(string); ok {
		return IsSupportedCurrency(c)
	}
	return false
}

ValidCurrency validates whether the currency is supported.

Functions

func IsSupportedCurrency

func IsSupportedCurrency(currency string) bool

IsSupportedCurrency returns true if the currncy is supported.

Types

This section is empty.

Jump to

Keyboard shortcuts

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