Skip to content

Commit 54f4666

Browse files
author
Pallab Maiti
authored
chore(release): 4.0.0
2 parents dc1a6ea + 7c4c3d1 commit 54f4666

File tree

208 files changed

+1315
-33252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+1315
-33252
lines changed

.buildscript/bootstrap.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Description
2+
3+
< Replace with adequate description for this PR>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Code Quality Checks
2+
on:
3+
pull_request:
4+
branches: ['v3.3']
5+
types: ['opened', 'reopened', 'synchronize']
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
go: [ '1.19', '1.18', '1.17' ]
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Setup Go ${{ matrix.go }}
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version: ${{ matrix.go }}
20+
21+
- name: Build Go ${{ matrix.go }}
22+
run: go build -v ./...
23+
- name: Test Go ${{ matrix.go }}
24+
run: go test ./... -v
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Check PR title
2+
on:
3+
pull_request:
4+
branches: ['v3.3']
5+
types: ['opened', 'reopened', 'edited', 'synchronize']
6+
7+
jobs:
8+
check_pr_title:
9+
name: Check PR title
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout source branch
13+
uses: actions/checkout@v3
14+
15+
- name: Check PR title
16+
uses: rudderlabs/github-action-check-pr-title@v1.0.7
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Notion PR Sync
2+
3+
on:
4+
issues:
5+
types:
6+
[
7+
opened,
8+
edited,
9+
deleted,
10+
transferred,
11+
pinned,
12+
unpinned,
13+
closed,
14+
reopened,
15+
assigned,
16+
unassigned,
17+
labeled,
18+
unlabeled,
19+
locked,
20+
unlocked,
21+
milestoned,
22+
demilestoned,
23+
]
24+
pull_request:
25+
types:
26+
[
27+
assigned,
28+
unassigned,
29+
labeled,
30+
unlabeled,
31+
opened,
32+
edited,
33+
closed,
34+
reopened,
35+
synchronize,
36+
converted_to_draft,
37+
ready_for_review,
38+
locked,
39+
unlocked,
40+
review_requested,
41+
review_request_removed,
42+
auto_merge_enabled,
43+
auto_merge_disabled,
44+
]
45+
46+
jobs:
47+
request:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Sync Github PRs to Notion
51+
uses: sivashanmukh/github-notion-pr-sync@1.0.0
52+
with:
53+
notionKey: ${{ secrets.NOTION_BOT_KEY }}
54+
notionDatabaseId: ${{ secrets.NOTION_PR_DB_ID }}
55+
githubKey: ${{ secrets.PAT }}

.github/workflows/slack-notify.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Notify Slack Channel
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy-tag:
9+
name: Notify Slack
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Send message to Slack channel
13+
id: slack
14+
uses: slackapi/slack-github-action@v1.23.0
15+
env:
16+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
17+
PROJECT_NAME: 'Go SDK'
18+
with:
19+
channel-id: "${{ secrets.SLACK_RELEASE_CHANNEL_ID }}"
20+
payload: |
21+
{
22+
"blocks": [
23+
{
24+
"type": "header",
25+
"text": {
26+
"type": "plain_text",
27+
"text": "New release: ${{ env.PROJECT_NAME }}"
28+
}
29+
},
30+
{
31+
"type": "divider"
32+
},
33+
{
34+
"type": "section",
35+
"text": {
36+
"type": "mrkdwn",
37+
"text": "*Release: <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}>*"
38+
}
39+
}
40+
]
41+
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ _testmain.go
3131
# Artifacts
3232
tmp/*
3333

34-
.vscode
34+
.vscode
35+
.DS_Store
36+
*.env

Readme.md

Lines changed: 84 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,62 @@
1+
<p align="center">
2+
<a href="https://rudderstack.com/">
3+
<img src="https://user-images.githubusercontent.com/59817155/121357083-1c571300-c94f-11eb-8cc7-ce6df13855c9.png">
4+
</a>
5+
</p>
6+
7+
<p align="center"><b>The Customer Data Platform for Developers</b></p>
8+
9+
<p align="center">
10+
<b>
11+
<a href="https://rudderstack.com">Website</a>
12+
·
13+
<a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-go-sdk/">Documentation</a>
14+
·
15+
<a href="https://rudderstack.com/join-rudderstack-slack-community">Community Slack</a>
16+
</b>
17+
</p>
18+
19+
<p align="center"><a href="https://github.com/rudderlabs/analytics-go"><img src="https://img.shields.io/github/v/release/rudderlabs/analytics-go.svg?label=Version"/></a></p>
20+
21+
----
22+
23+
# RudderStack Go SDK
24+
25+
The RudderStack Go SDK lets you send customer event data from your Go applications to your specified destinations.
26+
27+
## SDK setup requirements
28+
29+
- Set up a [RudderStack open source](https://app.rudderstack.com/signup?type=opensource) account.
30+
- Set up a Go source in the dashboard.
31+
- Copy the write key and the data plane URL. For more information, refer to the [Go SDK documentation](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-go-sdk/#sdk-setup-requirements).
132

233
## Installation
334

4-
The package can be simply installed via "go get", we recommend that you use a tool like
5-
Godep to avoid issues related to API breaking changes introduced between major
6-
versions of the library.
35+
You can install the Go SDK via the `go get` command.
736

8-
To install it in the GOPATH:
9-
```
37+
| It is highly recommended to use a tool like Godep to avoid any issues related to the breaking API changes introduced between the major versions of the library. |
38+
| :-----|
39+
40+
To install the SDK in the `GOPATH`, run the following:
41+
42+
```go
1043
go get github.com/rudderlabs/analytics-go
1144
```
1245

13-
14-
## Usage
46+
## Using the SDK
1547

1648
```go
1749
package main
1850

1951
import (
20-
"github.com/rudderlabs/analytics-go"
52+
"github.com/rudderlabs/analytics-go/v4"
2153
)
2254

2355
func main() {
24-
// Instantiates a client to use send messages to the Rudder API.
25-
// User your WRITE KEY in below placeholder "RUDDER WRITE KEY"
56+
// Instantiates a client to use send messages to the RudderStack API.
57+
58+
// Use your write key in the below placeholder:
59+
2660
client := analytics.New(<WRITE_KEY>, <DATA_PLANE_URL>)
2761

2862
// Enqueues a track event that will be sent asynchronously.
@@ -35,36 +69,67 @@ func main() {
3569
client.Close()
3670
}
3771
```
38-
OR
72+
73+
Alternatively, you can run the following snippet:
74+
3975
```go
4076
package main
4177

4278
import (
43-
"github.com/rudderlabs/analytics-go"
79+
"github.com/rudderlabs/analytics-go/v4"
4480
)
4581

4682
func main() {
47-
// Instantiates a client to use send messages to the Rudder API.
48-
// User your WRITE KEY in below placeholder "RUDDER WRITE KEY"
49-
client, _ := analytics.NewWithConfig(<WRITE_KEY>, <DATA_PLANE_URL>,
83+
// Instantiates a client to use send messages to the RudderStack API.
84+
85+
// User your write key in the below placeholder:
86+
87+
client, _ := analytics.NewWithConfig(WRITE_KEY,
5088
analytics.Config{
51-
Interval: 30 * time.Second,
52-
BatchSize: 100,
53-
Verbose: true,
89+
DataPlaneUrl: DATA_PLANE_URL,
90+
Interval: 30 * time.Second,
91+
BatchSize: 100,
92+
Verbose: true,
93+
Gzip: 0, // Enables Gzip compression - set to 1 to disable Gzip.
5494
})
5595

5696
// Enqueues a track event that will be sent asynchronously.
97+
5798
client.Enqueue(analytics.Track{
5899
UserId: "test-user",
59100
Event: "test-snippet",
60101
})
61102

62103
// Flushes any queued messages and closes the client.
104+
63105
client.Close()
64106
}
65107
```
66108

109+
## Gzip support
110+
111+
The Go SDK supports Gzip compression from version 4.0.0 and it is enabled (set to `0`) by default. However, you can disable this feature by setting the `Gzip` parameter to `1` while initializing the SDK, as shown:
112+
113+
```go
114+
client, _ := analytics.NewWithConfig(WRITE_KEY,
115+
analytics.Config{
116+
DataPlaneUrl: DATA_PLANE_URL,
117+
Interval: 30 * time.Second,
118+
BatchSize: 100,
119+
Verbose: true,
120+
Gzip: 0 // Enables Gzip compression - set to 1 to disable Gzip.
121+
})
122+
```
123+
124+
125+
126+
| Note: Gzip requires `rudder-server` version 1.4 or later. |
127+
| :-----|
128+
129+
## Sending events
130+
131+
Refer to the [RudderStack Go SDK documentation](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-go-sdk/) for more information on the supported event types.
67132

68133
## License
69134

70-
The library is released under the [MIT license](License.md).
135+
The RudderStack Go SDK is released under the [MIT license](License.md).

alias.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ type Alias struct {
1717
Timestamp time.Time `json:"timestamp,omitempty"`
1818
Context *Context `json:"context,omitempty"`
1919
Integrations Integrations `json:"integrations,omitempty"`
20-
}
21-
22-
func (msg Alias) internal() {
23-
panic(unimplementedError)
20+
Channel string `json:"channel,omitempty"`
2421
}
2522

2623
func (msg Alias) Validate() error {

0 commit comments

Comments
 (0)