MM-12389 Update segment library to v3 (#11472)

* Update analytics-go dependency

* Migrate from segment library v2 to v3

* Reinclude gorilla/handlers module

* Fix missing module

* Remove reference to outdated analytics module
Этот коммит содержится в:
Claudio Costa
2019-07-04 21:26:41 +02:00
коммит произвёл Christopher Speller
родитель c9e289f828
Коммит d844c52f06
34 изменённых файлов: 1599 добавлений и 459 удалений

40
vendor/github.com/segmentio/analytics-go/group.go сгенерированный поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1,40 @@
package analytics
import "time"
// This type represents object sent in a group call as described in
// https://segment.com/docs/libraries/http/#group
type Group struct {
// This field is exported for serialization purposes and shouldn't be set by
// the application, its value is always overwritten by the library.
Type string `json:"type,omitempty"`
MessageId string `json:"messageId,omitempty"`
AnonymousId string `json:"anonymousId,omitempty"`
UserId string `json:"userId,omitempty"`
GroupId string `json:"groupId"`
Timestamp time.Time `json:"timestamp,omitempty"`
Context *Context `json:"context,omitempty"`
Traits Traits `json:"traits,omitempty"`
Integrations Integrations `json:"integrations,omitempty"`
}
func (msg Group) validate() error {
if len(msg.GroupId) == 0 {
return FieldError{
Type: "analytics.Group",
Name: "GroupId",
Value: msg.GroupId,
}
}
if len(msg.UserId) == 0 && len(msg.AnonymousId) == 0 {
return FieldError{
Type: "analytics.Group",
Name: "UserId",
Value: msg.UserId,
}
}
return nil
}