-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
31 lines (24 loc) · 800 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"github.com/rudderlabs/analytics-go"
)
func main() {
// Instantiates a client to use send messages to the Rudder API.
/*client := analytics.New("24u1IBzLs4qz7e6Jfb7VYkvL82Z", "http://localhost:8080")
// Enqueues a track event that will be sent asynchronously.
client.Enqueue(analytics.Track{
UserId: "test-user",
Event: "test-snippet",
})
// Flushes any queued messages and closes the client.
client.Close()
fmt.Println("end")*/
clientCloud := analytics.New("24rFakUrc9PSv0skP14kOtcmkIM", "http://localhost:8081")
// Enqueues a track event that will be sent asynchronously.
clientCloud.Enqueue(analytics.Track{
UserId: "test-user-cloud",
Event: "test-snippet-cloud",
})
// Flushes any queued messages and closes the client.
clientCloud.Close()
}