Documentation ¶
Index ¶
- Variables
- func AddEvent(Exchange, Item, Condition string, CurrencyPair pair.CurrencyPair, ...) (int, error)
- func CheckEvents()
- func GetEventCounter() (int, int)
- func IsValidAction(Action string) bool
- func IsValidCondition(Condition string) bool
- func IsValidEvent(Exchange, Item, Condition, Action string) error
- func IsValidExchange(Exchange string) bool
- func IsValidItem(Item string) bool
- func RemoveEvent(EventID int) bool
- func SetComms(commsP *communications.Communications)
- type Event
Constants ¶
This section is empty.
Variables ¶
var Events []*Event
Events variable is a pointer array to the event structures that will be appended
Functions ¶
func AddEvent ¶
func AddEvent(Exchange, Item, Condition string, CurrencyPair pair.CurrencyPair, Asset, Action string) (int, error)
AddEvent adds an event to the Events chain and returns an index/eventID and an error
func CheckEvents ¶
func CheckEvents()
CheckEvents is the overarching routine that will iterate through the Events chain
func GetEventCounter ¶
GetEventCounter displays the emount of total events on the chain and the events that have been executed.
func IsValidAction ¶
IsValidAction validates passed in action
func IsValidCondition ¶
IsValidCondition validates passed in condition
func IsValidEvent ¶
IsValidEvent checks the actions to be taken and returns an error if incorrect
func IsValidExchange ¶
IsValidExchange validates the exchange
func SetComms ¶
func SetComms(commsP *communications.Communications)
SetComms is an interim function that will support a median integration. This sets the current comms package.
Types ¶
type Event ¶
type Event struct { ID int Exchange string Item string Condition string Pair pair.CurrencyPair Asset string Action string Executed bool }
Event struct holds the event variables
func (*Event) CheckCondition ¶
CheckCondition will check the event structure to see if there is a condition met
func (*Event) ExecuteAction ¶
ExecuteAction will execute the action pending on the chain