Documentation ¶
Overview ¶
Package pair is a generated protocol buffer package.
It is generated from these files:
currency/pair/pair.proto
It has these top-level messages:
CurrencyPair
Index ¶
- func Contains(pairs []CurrencyPair, p CurrencyPair, exact bool) bool
- func ContainsCurrency(p CurrencyPair, c string) bool
- func FindPairDifferences(oldPairs, newPairs []string) ([]string, []string)
- func LowerCurrencyItem(c string) string
- func UpperCurrencyItem(c string) string
- type CurrencyPair
- func CopyPairFormat(p CurrencyPair, pairs []CurrencyPair, exact bool) CurrencyPair
- func FormatPairs(pairs []string, delimiter, index string) []CurrencyPair
- func NewCurrencyPair(firstCurrency, secondCurrency string) CurrencyPair
- func NewCurrencyPairDelimiter(currency, delimiter string) CurrencyPair
- func NewCurrencyPairFromIndex(currency, index string) CurrencyPair
- func NewCurrencyPairFromString(currency string) CurrencyPair
- func RemovePairsByFilter(p []CurrencyPair, filter string) []CurrencyPair
- func (*CurrencyPair) Descriptor() ([]byte, []int)
- func (c *CurrencyPair) Display(delimiter string, uppercase bool) (pair string)
- func (c *CurrencyPair) Equal(p CurrencyPair, exact bool) bool
- func (m *CurrencyPair) GetDelimiter() string
- func (m *CurrencyPair) GetFirstCurrency() string
- func (m *CurrencyPair) GetSecondCurrency() string
- func (c *CurrencyPair) Pair() string
- func (*CurrencyPair) ProtoMessage()
- func (m *CurrencyPair) Reset()
- func (m *CurrencyPair) String() string
- func (c CurrencyPair) Swap() CurrencyPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains(pairs []CurrencyPair, p CurrencyPair, exact bool) bool
Contains checks to see if a specified pair exists inside a currency pair array
func ContainsCurrency ¶
func ContainsCurrency(p CurrencyPair, c string) bool
ContainsCurrency checks to see if a pair contains a specific currency
func FindPairDifferences ¶
FindPairDifferences returns pairs which are new or have been removed
func LowerCurrencyItem ¶
Lower converts the CurrencyItem object c to lowercase
func UpperCurrencyItem ¶
Upper converts the CurrencyItem object c to uppercase
Types ¶
type CurrencyPair ¶
type CurrencyPair struct { Delimiter string `protobuf:"bytes,1,opt,name=Delimiter" json:"Delimiter,omitempty"` FirstCurrency string `protobuf:"bytes,2,opt,name=FirstCurrency" json:"FirstCurrency,omitempty"` SecondCurrency string `protobuf:"bytes,3,opt,name=SecondCurrency" json:"SecondCurrency,omitempty"` }
func CopyPairFormat ¶
func CopyPairFormat(p CurrencyPair, pairs []CurrencyPair, exact bool) CurrencyPair
CopyPairFormat copies the pair format from a list of pairs once matched
func FormatPairs ¶
func FormatPairs(pairs []string, delimiter, index string) []CurrencyPair
FormatPairs formats a string array to a list of currency pairs with the supplied currency pair format
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 RemovePairsByFilter ¶
func RemovePairsByFilter(p []CurrencyPair, filter string) []CurrencyPair
RemovePairsByFilter checks to see if a pair contains a specific currency and removes it from the list of pairs
func (*CurrencyPair) Descriptor ¶
func (*CurrencyPair) Descriptor() ([]byte, []int)
func (*CurrencyPair) Display ¶
func (c *CurrencyPair) Display(delimiter string, uppercase bool) (pair string)
Display formats and returns the currency based on user preferences, overriding the default Pair() display
func (*CurrencyPair) Equal ¶
func (c *CurrencyPair) Equal(p CurrencyPair, exact bool) bool
Equal compares two currency pairs and returns whether or not they are equal
func (*CurrencyPair) GetDelimiter ¶
func (m *CurrencyPair) GetDelimiter() string
func (*CurrencyPair) GetFirstCurrency ¶
func (m *CurrencyPair) GetFirstCurrency() string
func (*CurrencyPair) GetSecondCurrency ¶
func (m *CurrencyPair) GetSecondCurrency() string
func (*CurrencyPair) Pair ¶
func (c *CurrencyPair) Pair() string
Pair returns a currency pair string
func (*CurrencyPair) ProtoMessage ¶
func (*CurrencyPair) ProtoMessage()
func (*CurrencyPair) Reset ¶
func (m *CurrencyPair) Reset()
func (*CurrencyPair) String ¶
func (m *CurrencyPair) String() string
func (CurrencyPair) Swap ¶
func (c CurrencyPair) Swap() CurrencyPair
Swap swaps the pairs first and second currencies