MM-24312: Fix Dependency updates (#14391)

Automatic Merge
Этот коммит содержится в:
Agniva De Sarker
2020-04-30 02:36:09 +05:30
коммит произвёл GitHub
родитель a3cf490a4d
Коммит 03a55367d9
899 изменённых файлов: 135672 добавлений и 158738 удалений

88
vendor/github.com/rudderlabs/analytics-go/History.md сгенерированный поставляемый
Просмотреть файл

@@ -1,88 +0,0 @@
v3.1.0 / 2019-09-20
===================
* add consistent panic error message
* Expose the Message interface Validate method
* return error if a custom type is enqueued
* Handle pointer types in Enqueue()
* message: update maxMessageBytes to 32KB
v3.0.1 / 2018-10-02
===================
* Migrate from Circle V1 format to Circle V2
* Adds CLI for sending segment events
* Vendor packages back-go and uuid instead of using gitsubmodules
v3.0.0 / 2016-06-02
===================
* 3.0 is a significant rewrite with multiple breaking changes.
* [Quickstart](https://segment.com/docs/sources/server/go/quickstart/).
* [Documentation](https://segment.com/docs/sources/server/go/).
* [GoDocs](https://godoc.org/gopkg.in/segmentio/analytics-go.v3).
* [What's New in v3](https://segment.com/docs/sources/server/go/#what-s-new-in-v3).
v2.1.0 / 2015-12-28
===================
* Add ability to set custom timestamps for messages.
* Add ability to set a custom `net/http` client.
* Add ability to set a custom logger.
* Fix edge case when client would try to upload no messages.
* Properly upload in-flight messages when client is asked to shutdown.
* Add ability to set `.integrations` field on messages.
* Fix resource leak with interval ticker after shutdown.
* Add retries and back-off when uploading messages.
* Add ability to set custom flush interval.
v2.0.0 / 2015-02-03
===================
* rewrite with breaking API changes
v1.2.0 / 2014-09-03
==================
* add public .Flush() method
* rename .Stop() to .Close()
v1.1.0 / 2014-09-02
==================
* add client.Stop() to flash/wait. Closes #7
v1.0.0 / 2014-08-26
==================
* fix response close
* change comments to be more go-like
* change uuid libraries
0.1.2 / 2014-06-11
==================
* add runnable example
* fix: close body
0.1.1 / 2014-05-31
==================
* refactor locking
0.1.0 / 2014-05-22
==================
* replace Debug option with debug package
0.0.2 / 2014-05-20
==================
* add .Start()
* add mutexes
* rename BufferSize to FlushAt and FlushInterval to FlushAfter
* lower FlushInterval to 5 seconds
* lower BufferSize to 20 to match other clients

31
vendor/github.com/rudderlabs/analytics-go/Makefile сгенерированный поставляемый
Просмотреть файл

@@ -1,31 +0,0 @@
ifndef CIRCLE_ARTIFACTS
CIRCLE_ARTIFACTS=tmp
endif
bootstrap:
.buildscript/bootstrap.sh
dependencies:
@go get -v -t ./...
vet:
@go vet ./...
test: vet
@mkdir -p ${CIRCLE_ARTIFACTS}
@go test -race -coverprofile=${CIRCLE_ARTIFACTS}/cover.out .
@go tool cover -func ${CIRCLE_ARTIFACTS}/cover.out -o ${CIRCLE_ARTIFACTS}/cover.txt
@go tool cover -html ${CIRCLE_ARTIFACTS}/cover.out -o ${CIRCLE_ARTIFACTS}/cover.html
build: test
@go build ./...
e2e:
@if [ "$(RUN_E2E_TESTS)" != "true" ]; then \
echo "Skipping end to end tests."; else \
go get github.com/segmentio/library-e2e-tester/cmd/tester; \
tester -segment-write-key=$(SEGMENT_WRITE_KEY) -webhook-auth-username=$(WEBHOOK_AUTH_USERNAME) -webhook-bucket=$(WEBHOOK_BUCKET) -path='cli' -concurrency=2 -skip='advance|alias'; fi
ci: dependencies test e2e
.PHONY: bootstrap dependencies vet test e2e ci

55
vendor/github.com/rudderlabs/analytics-go/Readme.md сгенерированный поставляемый
Просмотреть файл

@@ -1,28 +1,15 @@
# analytics-go [![Circle CI](https://circleci.com/gh/segmentio/analytics-go/tree/master.svg?style=shield)](https://circleci.com/gh/segmentio/analytics-go/tree/master) [![go-doc](https://godoc.org/github.com/segmentio/analytics-go?status.svg)](https://godoc.org/github.com/segmentio/analytics-go)
Segment analytics client for Go.
## Installation
The package can be simply installed via go get, we recommend that you use a
package version management system like the Go vendor directory or a tool like
The package can be simply installed via "go get", we recommend that you use a tool like
Godep to avoid issues related to API breaking changes introduced between major
versions of the library.
To install it in the GOPATH:
```
go get https://github.com/segmentio/analytics-go
go get https://github.com/rudderlabs/analytics-go
```
## Documentation
The links bellow should provide all the documentation needed to make the best
use of the library and the Segment API:
- [Documentation](https://segment.com/docs/libraries/go/)
- [godoc](https://godoc.org/gopkg.in/segmentio/analytics-go.v3)
- [API](https://segment.com/docs/libraries/http/)
- [Specs](https://segment.com/docs/spec/)
## Usage
@@ -30,14 +17,41 @@ use of the library and the Segment API:
package main
import (
"os"
"github.com/segmentio/analytics-go"
"github.com/rudderlabs/analytics-go"
)
func main() {
// Instantiates a client to use send messages to the segment API.
client := analytics.New(os.Getenv("SEGMENT_WRITE_KEY"))
// Instantiates a client to use send messages to the Rudder API.
// User your WRITE KEY in below placeholder "RUDDER WRITE KEY"
client := analytics.New(<WRITE_KEY>, <DATA_PLANE_URL>)
// Enqueues a track event that will be sent asynchronously.
client.Enqueue(analytics.Track{
UserId: "test-user",
Event: "test-snippet",
})
// Flushes any queued messages and closes the client.
client.Close()
}
```
OR
```go
package main
import (
"github.com/rudderlabs/analytics-go"
)
func main() {
// Instantiates a client to use send messages to the Rudder API.
// User your WRITE KEY in below placeholder "RUDDER WRITE KEY"
client, _ := analytics.NewWithConfig(<WRITE_KEY>, <DATA_PLANE_URL>,
analytics.Config{
Interval: 30 * time.Second,
BatchSize: 100,
Verbose: true,
})
// Enqueues a track event that will be sent asynchronously.
client.Enqueue(analytics.Track{
@@ -50,6 +64,7 @@ func main() {
}
```
## License
The library is released under the [MIT license](License.md).

2
vendor/github.com/rudderlabs/analytics-go/alias.go сгенерированный поставляемый
Просмотреть файл

@@ -5,7 +5,7 @@ import "time"
var _ Message = (*Alias)(nil)
// 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.

66
vendor/github.com/rudderlabs/analytics-go/analytics.go сгенерированный поставляемый
Просмотреть файл

@@ -64,9 +64,9 @@ type client struct {
// Instantiate a new client that uses the write key passed as first argument to
// send messages to the backend.
// The client is created with the default configuration.
func New(writeKey string) Client {
func New(writeKey string, dataPlaneUrl string) Client {
// Here we can ignore the error because the default config is always valid.
c, _ := NewWithConfig(writeKey, Config{})
c, _ := NewWithConfig(writeKey, dataPlaneUrl, Config{})
return c
}
@@ -75,11 +75,13 @@ func New(writeKey string) Client {
// The function will return an error if the configuration contained impossible
// values (like a negative flush interval for example).
// When the function returns an error the returned client will always be nil.
func NewWithConfig(writeKey string, config Config) (cli Client, err error) {
func NewWithConfig(writeKey string, dataPlaneUrl string, config Config) (cli Client, err error) {
if err = config.validate(); err != nil {
return
}
config.Endpoint = dataPlaneUrl
c := &client{
Config: makeConfig(config),
key: writeKey,
@@ -105,37 +107,61 @@ func makeHttpClient(transport http.RoundTripper) http.Client {
return httpClient
}
func makeContext() *Context {
context := Context{}
context.Library = LibraryInfo{
Name: "analytics-go",
Version: "1.0.0",
}
return &context
}
func makeAnonymousId(userId string) string {
if userId != "" {
return userId
}
return uid()
}
func dereferenceMessage(msg Message) Message {
switch m := msg.(type) {
case *Alias:
if m == nil {
return nil
}
return *m
case *Group:
if m == nil {
return nil
}
return *m
case *Identify:
if m == nil {
return nil
}
return *m
case *Page:
if m == nil {
return nil
}
return *m
case *Screen:
if m == nil {
return nil
}
return *m
case *Track:
if m == nil {
return nil
}
return *m
}
@@ -143,6 +169,7 @@ func dereferenceMessage(msg Message) Message {
}
func (c *client) Enqueue(msg Message) (err error) {
msg = dereferenceMessage(msg)
if err = msg.Validate(); err != nil {
return
@@ -156,36 +183,69 @@ func (c *client) Enqueue(msg Message) (err error) {
m.Type = "alias"
m.MessageId = makeMessageId(m.MessageId, id)
m.Timestamp = makeTimestamp(m.Timestamp, ts)
if m.Context == nil {
m.Context = makeContext()
}
msg = m
case Group:
m.Type = "group"
m.MessageId = makeMessageId(m.MessageId, id)
if m.AnonymousId == "" {
m.AnonymousId = makeAnonymousId(m.UserId)
}
m.Timestamp = makeTimestamp(m.Timestamp, ts)
if m.Context == nil {
m.Context = makeContext()
}
msg = m
case Identify:
m.Type = "identify"
m.MessageId = makeMessageId(m.MessageId, id)
if m.AnonymousId == "" {
m.AnonymousId = makeAnonymousId(m.UserId)
}
m.Timestamp = makeTimestamp(m.Timestamp, ts)
if m.Context == nil {
m.Context = makeContext()
}
msg = m
case Page:
m.Type = "page"
m.MessageId = makeMessageId(m.MessageId, id)
if m.AnonymousId == "" {
m.AnonymousId = makeAnonymousId(m.UserId)
}
m.Timestamp = makeTimestamp(m.Timestamp, ts)
if m.Context == nil {
m.Context = makeContext()
}
msg = m
case Screen:
m.Type = "screen"
m.MessageId = makeMessageId(m.MessageId, id)
if m.AnonymousId == "" {
m.AnonymousId = makeAnonymousId(m.UserId)
}
m.Timestamp = makeTimestamp(m.Timestamp, ts)
if m.Context == nil {
m.Context = makeContext()
}
msg = m
case Track:
m.Type = "track"
m.MessageId = makeMessageId(m.MessageId, id)
if m.AnonymousId == "" {
m.AnonymousId = makeAnonymousId(m.UserId)
}
m.Timestamp = makeTimestamp(m.Timestamp, ts)
if m.Context == nil {
m.Context = makeContext()
}
msg = m
default:

3
vendor/github.com/rudderlabs/analytics-go/config.go сгенерированный поставляемый
Просмотреть файл

@@ -82,7 +82,8 @@ type Config struct {
// This constant sets the default endpoint to which client instances send
// messages if none was explictly set.
const DefaultEndpoint = "https://api.segment.io"
const DefaultEndpoint = ""
// This constant sets the default flush interval used by client instances if
// none was explicitly set.

22
vendor/github.com/rudderlabs/analytics-go/context.go сгенерированный поставляемый
Просмотреть файл

@@ -7,7 +7,7 @@ import (
)
// This type provides the representation of the `context` object as defined in
// https://segment.com/docs/spec/common/#context
type Context struct {
App AppInfo `json:"app,omitempty"`
Campaign CampaignInfo `json:"campaign,omitempty"`
@@ -33,7 +33,7 @@ type Context struct {
}
// This type provides the representation of the `context.app` object as defined
// in https://segment.com/docs/spec/common/#context
type AppInfo struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
@@ -42,7 +42,7 @@ type AppInfo struct {
}
// This type provides the representation of the `context.campaign` object as
// defined in https://segment.com/docs/spec/common/#context
type CampaignInfo struct {
Name string `json:"name,omitempty"`
Source string `json:"source,omitempty"`
@@ -52,7 +52,7 @@ type CampaignInfo struct {
}
// This type provides the representation of the `context.device` object as
// defined in https://segment.com/docs/spec/common/#context
type DeviceInfo struct {
Id string `json:"id,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
@@ -64,14 +64,14 @@ type DeviceInfo struct {
}
// This type provides the representation of the `context.library` object as
// defined in https://segment.com/docs/spec/common/#context
type LibraryInfo struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
}
// This type provides the representation of the `context.location` object as
// defined in https://segment.com/docs/spec/common/#context
type LocationInfo struct {
City string `json:"city,omitempty"`
Country string `json:"country,omitempty"`
@@ -82,7 +82,7 @@ type LocationInfo struct {
}
// This type provides the representation of the `context.network` object as
// defined in https://segment.com/docs/spec/common/#context
type NetworkInfo struct {
Bluetooth bool `json:"bluetooth,omitempty"`
Cellular bool `json:"cellular,omitempty"`
@@ -91,14 +91,14 @@ type NetworkInfo struct {
}
// This type provides the representation of the `context.os` object as defined
// in https://segment.com/docs/spec/common/#context
type OSInfo struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
}
// This type provides the representation of the `context.page` object as
// defined in https://segment.com/docs/spec/common/#context
type PageInfo struct {
Hash string `json:"hash,omitempty"`
Path string `json:"path,omitempty"`
@@ -109,7 +109,7 @@ type PageInfo struct {
}
// This type provides the representation of the `context.referrer` object as
// defined in https://segment.com/docs/spec/common/#context
type ReferrerInfo struct {
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
@@ -118,7 +118,7 @@ type ReferrerInfo struct {
}
// This type provides the representation of the `context.screen` object as
// defined in https://segment.com/docs/spec/common/#context
type ScreenInfo struct {
Density int `json:"density,omitempty"`
Width int `json:"width,omitempty"`

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

@@ -5,7 +5,7 @@ import "time"
var _ Message = (*Group)(nil)
// 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.

2
vendor/github.com/rudderlabs/analytics-go/identify.go сгенерированный поставляемый
Просмотреть файл

@@ -5,7 +5,7 @@ import "time"
var _ Message = (*Identify)(nil)
// This type represents object sent in an identify call as described in
// https://segment.com/docs/libraries/http/#identify
type Identify struct {
// This field is exported for serialization purposes and shouldn't be set by
// the application, its value is always overwritten by the library.

2
vendor/github.com/rudderlabs/analytics-go/integrations.go сгенерированный поставляемый
Просмотреть файл

@@ -13,7 +13,7 @@ package analytics
// .Disable("Marketo"),
// }
//
// The specifications can be found at https://segment.com/docs/spec/common/#integrations
type Integrations map[string]interface{}
func NewIntegrations() Integrations {

2
vendor/github.com/rudderlabs/analytics-go/logger.go сгенерированный поставляемый
Просмотреть файл

@@ -43,5 +43,5 @@ func (l stdLogger) Errorf(format string, args ...interface{}) {
}
func newDefaultLogger() Logger {
return StdLogger(log.New(os.Stderr, "segment ", log.LstdFlags))
return StdLogger(log.New(os.Stderr, "rudder ", log.LstdFlags))
}

2
vendor/github.com/rudderlabs/analytics-go/page.go сгенерированный поставляемый
Просмотреть файл

@@ -5,7 +5,7 @@ import "time"
var _ Message = (*Page)(nil)
// This type represents object sent in a page call as described in
// https://segment.com/docs/libraries/http/#page
type Page struct {
// This field is exported for serialization purposes and shouldn't be set by
// the application, its value is always overwritten by the library.

2
vendor/github.com/rudderlabs/analytics-go/screen.go сгенерированный поставляемый
Просмотреть файл

@@ -5,7 +5,7 @@ import "time"
var _ Message = (*Screen)(nil)
// This type represents object sent in a screen call as described in
// https://segment.com/docs/libraries/http/#screen
type Screen struct {
// This field is exported for serialization purposes and shouldn't be set by
// the application, its value is always overwritten by the library.

2
vendor/github.com/rudderlabs/analytics-go/track.go сгенерированный поставляемый
Просмотреть файл

@@ -5,7 +5,7 @@ import "time"
var _ Message = (*Track)(nil)
// This type represents object sent in a track call as described in
// https://segment.com/docs/libraries/http/#track
type Track struct {
// This field is exported for serialization purposes and shouldn't be set by
// the application, its value is always overwritten by the library.

2
vendor/github.com/rudderlabs/analytics-go/traits.go сгенерированный поставляемый
Просмотреть файл

@@ -16,7 +16,7 @@ import "time"
// .Set("Role", "Jedi"),
// }
//
// The specifications can be found at https://segment.com/docs/spec/identify/#traits
type Traits map[string]interface{}
func NewTraits() Traits {