currency

package
v0.0.0-...-fa6240a Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedCurrency is an error when a currency is not supported
	ErrUnsupportedCurrency = errors.New("unsupported currency")
)

List of currency related errors

Functions

This section is empty.

Types

type Currency

type Currency int

Currency is a currency

const (
	USD Currency = iota + 1
)

List of supported currencies

func (Currency) IsValid

func (c Currency) IsValid() bool

IsValid returns true if currency is valid

func (Currency) MarshalJSON

func (c Currency) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Currency) Scan

func (c *Currency) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (Currency) String

func (c Currency) String() string

String implements Stringer

func (*Currency) UnmarshalJSON

func (c *Currency) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

func (Currency) Value

func (c Currency) Value() (driver.Value, error)

Value implements driver.Valuer interface

Jump to

Keyboard shortcuts

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