mattermost/vendor/github.com/segmentio/analytics-go
2019-10-02 20:13:38 +02:00
..
.gitignore MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
.gitmodules MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
alias.go Upgrading server package dependencies (#12559) 2019-10-02 20:13:38 +02:00
analytics.go Upgrading server package dependencies (#12559) 2019-10-02 20:13:38 +02:00
config.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
context.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
error.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
executor.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
group.go Upgrading server package dependencies (#12559) 2019-10-02 20:13:38 +02:00
History.md Upgrading server package dependencies (#12559) 2019-10-02 20:13:38 +02:00
identify.go Upgrading server package dependencies (#12559) 2019-10-02 20:13:38 +02:00
integrations.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
json.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
License.md MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
logger.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
Makefile Upgrading server package dependencies (#12559) 2019-10-02 20:13:38 +02:00
message.go Upgrading server package dependencies (#12559) 2019-10-02 20:13:38 +02:00
page.go Upgrading server package dependencies (#12559) 2019-10-02 20:13:38 +02:00
properties.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
Readme.md MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
screen.go Upgrading server package dependencies (#12559) 2019-10-02 20:13:38 +02:00
timeout_15.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
timeout_16.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00
track.go Upgrading server package dependencies (#12559) 2019-10-02 20:13:38 +02:00
traits.go MM-12389 Update segment library to v3 (#11472) 2019-07-04 12:26:41 -07:00

analytics-go Circle CI go-doc

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:

Usage

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

The library is released under the MIT license.