Skip to content

Commit b0c07c7

Browse files
author
Pallab Maiti
authored
chore(release): version 4.1.0
2 parents 54f4666 + a23ba14 commit b0c07c7

21 files changed

+38
-40
lines changed

.github/workflows/build-and-quality-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Code Quality Checks
22
on:
33
pull_request:
4-
branches: ['v3.3']
4+
branches: ['master']
55
types: ['opened', 'reopened', 'synchronize']
66

77
jobs:

.github/workflows/check-pr-title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Check PR title
22
on:
33
pull_request:
4-
branches: ['v3.3']
4+
branches: ['master']
55
types: ['opened', 'reopened', 'edited', 'synchronize']
66

77
jobs:

Readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func main() {
9090
Interval: 30 * time.Second,
9191
BatchSize: 100,
9292
Verbose: true,
93-
Gzip: 0, // Enables Gzip compression - set to 1 to disable Gzip.
93+
DisableGzip: false // Enables Gzip compression - set true to disable Gzip.
9494
})
9595

9696
// Enqueues a track event that will be sent asynchronously.
@@ -108,7 +108,7 @@ func main() {
108108

109109
## Gzip support
110110

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:
111+
The Go SDK supports Gzip compression from version 4.1.0 and it is enabled by default. However, you can disable this feature by setting the `DisableGzip` parameter to `true` while initializing the SDK, as shown:
112112

113113
```go
114114
client, _ := analytics.NewWithConfig(WRITE_KEY,
@@ -117,7 +117,7 @@ client, _ := analytics.NewWithConfig(WRITE_KEY,
117117
Interval: 30 * time.Second,
118118
BatchSize: 100,
119119
Verbose: true,
120-
Gzip: 0 // Enables Gzip compression - set to 1 to disable Gzip.
120+
DisableGzip: false // Enables Gzip compression - set true to disable Gzip.
121121
})
122122
```
123123

analytics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
)
1919

2020
// Version of the client.
21-
const Version = "4.0.0"
21+
const Version = "4.1.0"
2222

2323
// This interface is the main API exposed by the analytics package.
2424
// Values that satsify this interface are returned by the client constructors
@@ -449,7 +449,7 @@ func (c *client) upload(b []byte, targetNode string) error {
449449
req *http.Request
450450
reqError error
451451
)
452-
if c.Config.Gzip == 0 {
452+
if !c.Config.DisableGzip {
453453
gzipPayload := func(data []byte) (io.Reader, error) {
454454
var b bytes.Buffer
455455
gz, err := gzip.NewWriterLevel(&b, gzip.BestSpeed)

analytics_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ func ExampleTrack() {
231231
// "context": {
232232
// "library": {
233233
// "name": "analytics-go",
234-
// "version": "4.0.0"
234+
// "version": "4.1.0"
235235
// }
236236
// },
237237
// "event": "Download",
@@ -493,7 +493,7 @@ func TestDisableGzipSupport(t *testing.T) {
493493
BatchSize: 1,
494494
now: mockTime,
495495
uid: mockId,
496-
Gzip: 1,
496+
DisableGzip: true,
497497
})
498498
defer client.Close()
499499

@@ -763,8 +763,8 @@ func TestClientNewRequestError(t *testing.T) {
763763
nil,
764764
func(m Message, e error) { errchan <- e },
765765
},
766-
Transport: testTransportOK,
767-
Gzip: 1,
766+
Transport: testTransportOK,
767+
DisableGzip: true,
768768
})
769769

770770
client.Enqueue(Track{UserId: "A", Event: "B"})

config.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ type Config struct {
9292
// Maximum bytes in a batch
9393
MaxBatchBytes int
9494

95-
// Disable/enable gzip support. 0 = Enable, 1 = Disable
95+
// Deprecated: Gzip is deprecated, will be removed in next releases. Use DisableGzip.
9696
Gzip int
97+
98+
// Disable/enable gzip support.
99+
DisableGzip bool
97100
}
98101

99102
// This constant sets the default endpoint to which client instances send
@@ -202,6 +205,10 @@ func makeConfig(c Config) Config {
202205
c.MaxBatchBytes = defMaxBatchBytes
203206
}
204207

208+
if c.Gzip != 0 {
209+
c.DisableGzip = true
210+
}
211+
205212
// We always overwrite the 'library' field of the default context set on the
206213
// client because we want this information to be accurate.
207214
c.DefaultContext.Library = LibraryInfo{

example/example.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func main() {
3434
Interval: 30 * time.Second,
3535
BatchSize: 100,
3636
Verbose: true,
37+
DisableGzip: false,
3738
})
3839
defer client.Close()
3940

fixtures/test-context-track.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"context": {
55
"library": {
66
"name": "analytics-go",
7-
"version": "4.0.0"
7+
"version": "4.1.0"
88
},
99
"whatever": "here"
1010
},

fixtures/test-enqueue-alias.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"context": {
1010
"library": {
1111
"name": "analytics-go",
12-
"version": "4.0.0"
12+
"version": "4.1.0"
1313
}
1414
},
1515
"channel": "server"

fixtures/test-enqueue-group.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"context": {
1010
"library": {
1111
"name": "analytics-go",
12-
"version": "4.0.0"
12+
"version": "4.1.0"
1313
}
1414
},
1515
"channel": "server",

0 commit comments

Comments
 (0)