Documentation ¶
Index ¶
- Variables
- func AddEvent(exchange, item, condition string, currencyPair currency.Pair, ...) (int, error)
- func CheckEvents()
- func GetEventCounter() (total, executed 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 currency.Pair, 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 ¶
func GetEventCounter() (total, executed int)
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 currency.Pair 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