pair

package
v0.0.0-...-e8e934d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrencyItem

type CurrencyItem string

CurrencyItem is an exported string with methods to manipulate the data instead of using array/slice access modifiers

func (CurrencyItem) Lower

func (c CurrencyItem) Lower() CurrencyItem

Lower converts the CurrencyItem object c to lowercase

func (CurrencyItem) String

func (c CurrencyItem) String() string

String converts the CurrencyItem object c to string

func (CurrencyItem) Upper

func (c CurrencyItem) Upper() CurrencyItem

Upper converts the CurrencyItem object c to uppercase

type CurrencyPair

type CurrencyPair struct {
	Delimiter      string       `json:"delimiter"`
	FirstCurrency  CurrencyItem `json:"first_currency"`
	SecondCurrency CurrencyItem `json:"second_currency"`
}

CurrencyPair holds currency pair information

func NewCurrencyPair

func NewCurrencyPair(firstCurrency, secondCurrency string) CurrencyPair

NewCurrencyPair returns a CurrencyPair without a delimiter

func NewCurrencyPairDelimiter

func NewCurrencyPairDelimiter(currency, delimiter string) CurrencyPair

NewCurrencyPairDelimiter splits the desired currency string at delimeter, the returns a CurrencyPair struct

func NewCurrencyPairFromIndex

func NewCurrencyPairFromIndex(currency, index string) CurrencyPair

NewCurrencyPairFromIndex returns a CurrencyPair via a currency string and specific index

func NewCurrencyPairFromString

func NewCurrencyPairFromString(currency string) CurrencyPair

NewCurrencyPairFromString converts currency string into a new CurrencyPair with or without delimeter

func (CurrencyPair) Display

func (c CurrencyPair) Display(delimiter string, uppercase bool) CurrencyItem

Display formats and returns the currency based on user preferences, overriding the default Pair() display

func (CurrencyPair) Equal

func (c CurrencyPair) Equal(p CurrencyPair) bool

Equal compares two currency pairs and returns whether or not they are equal

func (CurrencyPair) GetFirstCurrency

func (c CurrencyPair) GetFirstCurrency() CurrencyItem

GetFirstCurrency returns the first currency item

func (CurrencyPair) GetSecondCurrency

func (c CurrencyPair) GetSecondCurrency() CurrencyItem

GetSecondCurrency returns the second currency item

func (CurrencyPair) Pair

func (c CurrencyPair) Pair() CurrencyItem

Pair returns a currency pair string

Jump to

Keyboard shortcuts

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