1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-10 18:10:49 +09:00

GO-2050 Add inHouse key

This commit is contained in:
Mikhail Iudin 2023-12-04 14:39:26 +01:00
parent 2d92f5c01f
commit ed1d355d7b
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
6 changed files with 28 additions and 26 deletions

View file

@ -28,7 +28,7 @@ const (
)
const amplEndpoint = "https://amplitude.anytype.io/2/httpapi"
const inhouseEndpoint = "https://telemetry.anytype.io/2/httpapi"
const inHouseEndpoint = "https://telemetry.anytype.io/2/httpapi"
type SamplableEvent interface {
amplitude.Event
@ -38,7 +38,7 @@ type SamplableEvent interface {
}
type MetricsService interface {
InitAmplWithKey(k string)
InitWithKeys(amplKey string, inHouseKey string)
SetAppVersion(v string)
SetStartVersion(v string)
SetDeviceId(t string)
@ -85,16 +85,16 @@ func NewService() MetricsService {
aggregatableChan: make(chan SamplableEvent, bufferSize),
ctx: ctx,
cancel: cancel,
amplitude: amplitude.New(inhouseEndpoint, ""),
},
},
}
}
func (s *service) InitAmplWithKey(key string) {
func (s *service) InitWithKeys(amplKey string, inHouseKey string) {
s.lock.Lock()
defer s.lock.Unlock()
s.clients[ampl].amplitude = amplitude.New(amplEndpoint, key)
s.clients[ampl].amplitude = amplitude.New(amplEndpoint, amplKey)
s.clients[inhouse].amplitude = amplitude.New(inHouseEndpoint, inHouseKey)
}
func (s *service) SetDeviceId(t string) {