-
Notifications
You must be signed in to change notification settings - Fork 32
/
proto_http.go
33 lines (29 loc) · 903 Bytes
/
proto_http.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
32
33
package ably
import (
"fmt"
"runtime"
)
// constants for rsc7
const (
ablyVersionHeader = "X-Ably-Version"
ablyErrorCodeHeader = "X-Ably-Errorcode"
ablyErrorMessageHeader = "X-Ably-Errormessage"
libraryVersion = "1.2.10"
libraryName = "go"
ablyVersion = "1.2"
ablyClientIDHeader = "X-Ably-ClientId"
hostHeader = "Host"
ablyAgentHeader = "Ably-Agent" // RSC7d
ablySDKIdentifier = "ably-go/" + libraryVersion // RSC7d1
)
var goRuntimeIdentifier = func() string {
return fmt.Sprintf("%s/%s", libraryName, runtime.Version()[2:])
}()
var ablyAgentIdentifier = func() string {
osIdentifier := goOSIdentifier()
if empty(osIdentifier) {
return fmt.Sprintf("%s %s", ablySDKIdentifier, goRuntimeIdentifier)
} else {
return fmt.Sprintf("%s %s %s", ablySDKIdentifier, goRuntimeIdentifier, osIdentifier)
}
}()