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
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
c9e289f828
Коммит
d844c52f06
38
vendor/github.com/segmentio/analytics-go/alias.go
сгенерированный
поставляемый
Обычный файл
38
vendor/github.com/segmentio/analytics-go/alias.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,38 @@
|
||||
package analytics
|
||||
|
||||
import "time"
|
||||
|
||||
// This type represents object sent in a alias call as described in
|
||||
// https://segment.com/docs/libraries/http/#alias
|
||||
type Alias 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"`
|
||||
PreviousId string `json:"previousId"`
|
||||
UserId string `json:"userId"`
|
||||
Timestamp time.Time `json:"timestamp,omitempty"`
|
||||
Context *Context `json:"context,omitempty"`
|
||||
Integrations Integrations `json:"integrations,omitempty"`
|
||||
}
|
||||
|
||||
func (msg Alias) validate() error {
|
||||
if len(msg.UserId) == 0 {
|
||||
return FieldError{
|
||||
Type: "analytics.Alias",
|
||||
Name: "UserId",
|
||||
Value: msg.UserId,
|
||||
}
|
||||
}
|
||||
|
||||
if len(msg.PreviousId) == 0 {
|
||||
return FieldError{
|
||||
Type: "analytics.Alias",
|
||||
Name: "PreviousId",
|
||||
Value: msg.PreviousId,
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Ссылка в новой задаче
Block a user