pair

package
v0.0.0-...-b8e8dbd Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: MIT Imports: 5 Imported by: 0

README

GoCryptoTrader package Pair

Build Status Software License GoDoc Coverage Status Go Report Card

This pair package is part of the GoCryptoTrader codebase.

This is still in active development

You can track ideas, planned features and what's in progresss on this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.

Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack

Current Features for pair

  • This package services the currency package.
Please click GoDocs chevron above to view current GoDoc information for this package

Contribution

Please feel free to submit any pull requests or suggest any desired features to be added.

When submitting a PR, please abide by our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Code must adhere to our coding style.
  • Pull requests need to be based on and opened against the master branch.

Donations

If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:

1F5zVDgNjorJ51oGebSvNCrSAHpwGkUdDB

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

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

func FindPairDifferences(oldPairs, newPairs []string) ([]string, []string)

FindPairDifferences returns pairs which are new or have been removed

func LowerCurrencyItem

func LowerCurrencyItem(c string) string

Lower converts the CurrencyItem object c to lowercase

func UpperCurrencyItem

func UpperCurrencyItem(c string) string

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

Jump to

Keyboard shortcuts

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