You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bayeux Client Protocol (as specified by Salesforce Realtime API)
2
+
Bayeux Client Protocol implemented in Golang (as specified by Salesforce Realtime API)
3
+
4
+
# Usage
5
+
See `examples/main.go`
6
+
```golang
7
+
package main
8
+
9
+
import (
10
+
"fmt"
11
+
12
+
bay "github.com/zph/bayeux"
13
+
)
14
+
15
+
funcExample() {
16
+
b:= bay.Bayeux{}
17
+
creds:= bay.GetSalesforceCredentials()
18
+
c:= b.TopicToChannel(creds, "topicName")
19
+
for {
20
+
select {
21
+
casee:=<-c:
22
+
fmt.Printf("TriggerEvent Received: %+v", e)
23
+
}
24
+
}
25
+
}
26
+
27
+
funcmain() {
28
+
Example()
29
+
}
30
+
```
31
+
32
+
See annotations in code for cases where the Salesforce implementation of Bayeux seems to differ from official spec.
33
+
34
+
Salesforce documentation on Realtime API: https://resources.docs.salesforce.com/sfdc/pdf/api_streaming.pdf
35
+
36
+
# Stability
37
+
38
+
This code or variant thereof has been steadily running in production since Nov 2016.
39
+
40
+
The API is very new. So only a few functions are exposed publicly and these can be expected to remain stable until 12/2018, pending massive changes to Salesforce API. Reasonable attempts will be made to maintain API past that deadline.
0 commit comments