
Work In Progress
Just the right piece for your puzzle.

go get -u github.com/leandergangso/spotware-sdk
Overview
This is a small library for Spotware OpenAPI.
Getting Started
Let's take a look at a minimal setup:
package main
import (
"fmt"
"log"
"time"
"github.com/leandergangso/spotware-sdk"
)
func main() {
sdk, err := spotware.NewClient(spotware.Settings{
// credentials from your spotware application
ClientID: "YOUR CLIENT ID",
Secret: "YOUR SECRET",
})
if err != nil {
log.Fatal(err)
}
defer sdk.Stop() // option for safe exit (finish all messages in que before exit)
sdk.Receive(sdk.Events.OnMessage, func(msg *spotware.ProtoMessage) { // ADD CORRECT PARAMETER FOR FUNCTION !!!
fmt.Println(msg.)
})
protoMsg := &spotware.Proto.ProtoOAAccountAuthReq{
CtidTraderAccountId: 123456,
AccessToken: "TOKEN HERE",
}
err = sdk.Send(protoMsg)
if err != nil {
log.Println("can't send given proto message:", err)
}
sdk.Start()
}
Setup
First, we have to make sure the protobuf messages are up to date.
Make sure make
and protoc
is installed.
# check and update
make proto
# on error, add next line to *.proto files
option go_package = ".;message";
# again run
make proto