currency

package
v0.0.0-...-b3f3fbb Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package currency currency-related logic

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCurrencyNotFound is an error which various select methods will return
	// if the requested currency was not found
	ErrCurrencyNotFound = errors.New("currency not found")
)

Functions

This section is empty.

Types

type Currency

type Currency struct {
	CodeISO4217 string
}

Currency represents a currency in ISO4217 code

func CurrencyAllDB

func CurrencyAllDB(db *sql.DB) ([]Currency, error)

CurrencyAllDB selects all available currencies

func CurrencyByCodeISO4217DB

func CurrencyByCodeISO4217DB(db *sql.DB, codeISO4217 string) (Currency, error)

CurrencyByCodeISO4217DB selects a currency by the given code

If no such currency exists, it will return an empty currency

func CurrencyByCodeISO4217Tx

func CurrencyByCodeISO4217Tx(db *sql.Tx, codeISO4217 string) (Currency, error)

CurrencyByCodeISO4217Tx selects a currency by the given code

If no such currency exists, it will return an empty currency

func (Currency) IsEmpty

func (c Currency) IsEmpty() bool

IsEmpty returns true if the currency is considered empty/uninitialized

func (Currency) MarshalJSON

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

Jump to

Keyboard shortcuts

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