Skip to content

Commit 6742b65

Browse files
implement Forward Protocol v1.5 custom marshal/unmarshal for EntryExt (#70)
- Add custom msgpack decode and unmarshal functions for EntryExt struct to support Fluent Forward Protocol v1.5 specification - Update all dependencies - Update .travis.yml - Update .golangci.yml --------- Signed-off-by: Mirko Lazarevic <[email protected]>
1 parent 52a98c7 commit 6742b65

24 files changed

+576
-354
lines changed

.golangci.yml

Lines changed: 57 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,70 @@
1+
version: "2"
2+
13
run:
2-
# timeout for analysis, e.g. 30s, 5m, default is 1m
4+
# Timeout for total work, e.g. 30s, 5m, 5m30s.
5+
# If the value is lower or equal to 0, the timeout is disabled.
6+
# Default: 0 (disabled)
37
timeout: 3m
8+
9+
# Include test files or not.
10+
# Default: true
11+
tests: false
412
linters:
5-
# enable some additional (non-default) linters
613
enable:
7-
- revive
814
- bodyclose
9-
- exportloopref
10-
- gocognit
1115
- goconst
12-
- gofmt
1316
- gosec
1417
- misspell
1518
- nakedret
19+
- revive
1620
- unconvert
1721
- unparam
18-
- wsl
22+
settings:
23+
goconst:
24+
min-len: 2
25+
min-occurrences: 5
26+
misspell:
27+
locale: US
28+
revive:
29+
rules:
30+
- name: unused-parameter
31+
disabled: true
32+
exclusions:
33+
generated: lax
34+
presets:
35+
- comments
36+
- common-false-positives
37+
- legacy
38+
- std-error-handling
39+
rules:
40+
- linters:
41+
- errcheck
42+
- gocognit
43+
- goconst
44+
- gosec
45+
- unparam
46+
- wsl
47+
path: _test\.go
48+
- linters:
49+
- errcheck
50+
- gocognit
51+
- goconst
52+
- gosec
53+
- unparam
54+
- wsl
55+
path: _gen\.go
56+
paths:
57+
- third_party$
58+
- builtin$
59+
- examples$
1960
issues:
20-
exclude-rules:
21-
# exclude some linters from running on tests files.
22-
- path: _test\.go
23-
linters:
24-
- errcheck
25-
- exportloopref
26-
- gocognit
27-
- goconst
28-
- gosec
29-
- unparam
30-
- wsl
31-
- revive
32-
- path: '(.+)_test.go'
33-
linters:
34-
- revive
35-
text: "dot-imports: should not use dot imports"
36-
# maximum count of issues with the same text. set to 0 to disable. default is 3.
3761
max-same-issues: 0
38-
linters-settings:
39-
goconst:
40-
min-len: 2
41-
min-occurrences: 5
42-
misspell:
43-
locale: US
62+
formatters:
63+
enable:
64+
- gofmt
65+
exclusions:
66+
generated: lax
67+
paths:
68+
- third_party$
69+
- builtin$
70+
- examples$

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ language: go
33
os: linux
44
dist: focal
55
go:
6-
- "1.20.14"
6+
- "1.24.x"
77

88
before_install:
99
- pip --quiet install yamllint

fluent/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func (c *Client) checkAck(chunk string) error {
258258
}
259259

260260
if ack.Ack != chunk {
261-
return fmt.Errorf("Expected chunk %s, but got %s", chunk, ack.Ack)
261+
return fmt.Errorf("expected chunk %s, but got %s", chunk, ack.Ack)
262262
}
263263

264264
return nil

fluent/client/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ var _ = Describe("Client", func() {
238238
defer GinkgoRecover()
239239
defer func() { done <- true }()
240240
err := client.Send(&msg)
241-
Expect(err.Error()).To(ContainSubstring("Expected chunk"))
241+
Expect(err.Error()).To(ContainSubstring("expected chunk"))
242242
}()
243243

244244
rcvd := &protocol.MessageExt{}

fluent/client/clientfakes/fake_connection_factory.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fluent/client/clientfakes/fake_message_client.go

Lines changed: 0 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fluent/client/clientfakes/fake_wsconnection_factory.go

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fluent/client/ws/ext/extfakes/fake_conn.go

Lines changed: 0 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fluent/client/ws/wsfakes/fake_connection.go

Lines changed: 0 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fluent/protocol/forward_message.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ func NewForwardMessage(
7171
}
7272

7373
func (fm *ForwardMessage) EncodeMsg(dc *msgp.Writer) error {
74-
size := 2
74+
size := uint32(2)
7575
if fm.Options != nil {
7676
size = 3
7777
}
7878

79-
err := dc.WriteArrayHeader(uint32(size))
79+
err := dc.WriteArrayHeader(size)
8080
if err != nil {
8181
return msgp.WrapError(err, "Array Header")
8282
}

0 commit comments

Comments
 (0)