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
55
vendor/github.com/segmentio/analytics-go/Readme.md
сгенерированный
поставляемый
55
vendor/github.com/segmentio/analytics-go/Readme.md
сгенерированный
поставляемый
@@ -1,8 +1,55 @@
|
||||
# analytics-go
|
||||
# analytics-go [](https://circleci.com/gh/segmentio/analytics-go/tree/master) [](https://godoc.org/github.com/segmentio/analytics-go)
|
||||
|
||||
Segment analytics client for Go. For additional documentation
|
||||
visit [https://segment.com/docs/libraries/go](https://segment.com/docs/libraries/go/) or view the [godocs](http://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
|
||||
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
|
||||
```
|
||||
|
||||
## 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
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/segmentio/analytics-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Instantiates a client to use send messages to the segment API.
|
||||
client := analytics.New(os.Getenv("SEGMENT_WRITE_KEY"))
|
||||
|
||||
// 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()
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
The library is released under the [MIT license](License.md).
|
||||
|
||||
Ссылка в новой задаче
Block a user