This Package is a simple solution for segmentio API Go binding. For the server side analysing.
go get "github.com/athom/gosegmentio"
package main
import (
"github.com/athom/gosegmentio"
)
func main() {
gosegmentio.SetSecretToken("your secrect token")
gosegmentio.Identify("112", map[string]interface{}{
"Name": "Kioshi",
"Age": 230,
"Country": "Earth Kindom",
}, map[string]interface{}{})
gosegmentio.Track("112", "DeadAt", map[string]interface{}{
"Age": 230,
"Date": "82 BSC",
"Location": "Kioshi Island",
}, map[string]interface{}{})
gosegmentio.Track("102", "AnomynousEvent", map[string]interface{}{
"Hey": "There",
}, map[string]interface{}{})
gosegmentio.Alias("102", "113", map[string]interface{}{})
gosegmentio.Identify("113", map[string]interface{}{
"Name": "Roku",
"Age": 70,
"Country": "Fire Nation",
}, map[string]interface{}{})
gosegmentio.Track("113", "BornAt", map[string]interface{}{
"Age": 0,
"Date": "82 BSC",
"Location": "Fire Nation",
}, map[string]interface{}{})
gosegmentio.Track("113", "DeadAt", map[string]interface{}{
"Age": 70,
"Date": "12 BSC",
"Location": "Fire Nation",
}, map[string]interface{}{})
}Please refer the examples;
It is released under the WTFPL License.
