Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release v3 #405

Merged
merged 54 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
e2de6b7
merge {tcp,udp}/message to message
jkralik Jul 8, 2022
2cd757f
MessageID as int32 and type as int16 for invalid values
jkralik Jul 18, 2022
3a905a5
fix Pool.ReleaseMessage
jkralik Jul 19, 2022
30deb51
use new sync.Map instead of handler container
jkralik Jul 18, 2022
0befdba
merge responseWriters
jkralik Jul 18, 2022
1021b14
merge observation handler
jkralik Jul 19, 2022
2576c54
remove client wrapper
jkralik Jul 19, 2022
47ef3d5
cleanup connection
jkralik Jul 19, 2022
67f0d89
sonar exclude **/main.go
jkralik Jul 19, 2022
1ab04bf
dont set ETag to responses, because it is optional
jkralik Jul 20, 2022
a59d753
merge mux response writer
jkralik Jul 20, 2022
3ce2dc3
fix after CR
jkralik Jul 21, 2022
1dab88f
use generics in BW transfer
jkralik Jul 20, 2022
14ade7e
merge common client commands
jkralik Jul 20, 2022
5974e25
tcp options as global pkg
jkralik Jul 20, 2022
15ab455
udp options as global pkg
jkralik Jul 21, 2022
f77c582
dtls options as global pkg
jkralik Jul 21, 2022
59aa9cc
observe fail
jkralik Jul 21, 2022
f4f70a4
merge common configs
jkralik Aug 1, 2022
5c68c57
refactore inactivity
jkralik Aug 1, 2022
2a0f3d0
introduce github.com/plgd-dev/go-coap/v3
jkralik Aug 1, 2022
8a7feb8
fix net/TestTLSListenerAcceptWithContext
jkralik Aug 1, 2022
09c37fc
refactore cache package
jkralik Aug 1, 2022
4c03623
update status to pool.Message
jkralik Aug 4, 2022
01a9efb
allow to set/change context in pool.Message
jkralik Aug 5, 2022
19667c6
allow to observe with customized request
jkralik Aug 5, 2022
0a8ee20
cleanup server dial options, client
jkralik Aug 5, 2022
1698a60
mux.ClientConn add AddOnClose
jkralik Aug 5, 2022
d1c0c08
add factories for create requests to mux.ClientConn
jkralik Aug 5, 2022
b6a4033
net/dtlslistener: use parallel handshakes for connections
jkralik Aug 11, 2022
665b6af
setup go 1.18
jkralik Aug 11, 2022
3848d7e
udp/dtls: allow set mtu size
jkralik Aug 11, 2022
ba2022c
fix leaking of pool.Message
jkralik Aug 12, 2022
5047438
nstart - max number of simultaneous outstanding requests to the server
jkralik Aug 3, 2022
884f053
update github.com/pion/dtls/v2 v2.1.6-0.20220815090156-a04cfccb23e5
jkralik Aug 15, 2022
de0912f
fix - make sure message type is propagated when creating new messages
andersroos Sep 6, 2022
ede835f
Update linters and fix reported issues (#393)
Danielius1922 Sep 21, 2022
56ecb12
allow to limit client parallel requests
jkralik Sep 21, 2022
7a6d0a5
fix for lint - revive
jkralik Sep 21, 2022
8cabc5f
test: allow tests with parallel POST, PUT, DELETE
jkralik Sep 21, 2022
2b0032d
only limited number of request can be processed parallel per endpoint
jkralik Sep 21, 2022
b2e91ea
fix go.sum
jkralik Sep 26, 2022
15f9067
Merge branch 'master' into jkralik/merge/v2
jkralik Sep 26, 2022
b0cdfea
Merge pull request #398 from plgd-dev/jkralik/merge/v2
jkralik Sep 26, 2022
154e3fa
Merge branch 'master' into jkralik/merge/master
jkralik Sep 28, 2022
d050370
Merge pull request #400 from plgd-dev/jkralik/merge/master
jkralik Sep 28, 2022
d785fc0
fix - reset Message.Payload
jkralik Oct 4, 2022
7601bbc
update README.md about requirements
jkralik Oct 7, 2022
8134d48
expose goPool parameters
jkralik Oct 4, 2022
86eb155
workflows: use newest golang
jkralik Oct 5, 2022
5cadbb1
Merge branch 'master' into v3
jkralik Oct 7, 2022
88a0247
fix smells
jkralik Oct 7, 2022
e5ec65d
upgrade packages
jkralik Oct 7, 2022
c408e31
update github.com/pion/udp v0.1.2-0.20221011090648-2589407f52c9
jkralik Oct 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ignore:
- "examples"
- "**/*_test.go"
- "v3"
3 changes: 2 additions & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go 1.18
- name: Set up Go 1.18+
uses: actions/setup-go@v3
with:
go-version: "^1.18" # The Go version to download (if necessary) and use.
check-latest: true

- run: go version

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/staticAnalysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go 1.18
- name: Set up Go 1.18+
uses: actions/setup-go@v3
with:
go-version: "^1.18" # The Go version to download (if necessary) and use.
check-latest: true

- run: go version

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test-for-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Set up Go 1.18
- name: Set up Go 1.18+
uses: actions/setup-go@v3
with:
go-version: ^1.18
go-version: "^1.18"
check-latest: true

- run: go version

# Checks-out repository under $GITHUB_WORKSPACE
- name: Checkout
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Set up Go 1.18
- name: Set up Go 1.18+
uses: actions/setup-go@v3
with:
go-version: ^1.18
go-version: "^1.18"
check-latest: true

- run: go version

# Checks-out repository under $GITHUB_WORKSPACE
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ server
client
!client/
vendor/
v3/

# Test binary, build with `go test -c`
*.test
Expand Down
15 changes: 11 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ linters:
# - exhaustive # check exhaustiveness of enum switch statements
- exportloopref # checks for pointers to enclosing loop variables
# - forbidigo # Forbids identifiers
# - forcetypeassert # finds forced type assertions
- forcetypeassert # finds forced type assertions
- gci # Gci control golang package import order and make it always deterministic.
# - gochecknoglobals # Checks that no globals are present in Go code
# - gochecknoinits # Checks that no init functions are present in Go code
# - gocognit # Computes and checks the cognitive complexity of functions
- goconst # Finds repeated strings that could be replaced by a constant
- gocritic # The most opinionated Go source code linter
# - gocyclo # Computes and checks the cyclomatic complexity of functions
- gocyclo # Computes and checks the cyclomatic complexity of functions
# - godox # Tool for detection of FIXME, TODO and other comment keywords
# - goerr113 # Golang linter to check the errors handling expressions
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
Expand Down Expand Up @@ -98,22 +98,29 @@ issues:
- path: _test\.go
linters:
- dupl
- forcetypeassert
- gosec

- path: ^test/.*\.go
linters:
- dupl
- forcetypeassert
- gosec

- path: example_test\.go
text: "exitAfterDefer"
linters:
- gocritic

- path: udp/message/getmid.go
- path: message/getmid.go
text: "G404: Use of weak random number generator \\(math/rand instead of crypto/rand\\)"
linters:
- gosec
- gosec

- path: example_test\.go
text: "exitAfterDefer"
linters:
- gocritic

# # Fix found issues (if it's supported by the linter).
# fix: true
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
"go.testEnvVars": {
// "GOFLAGS":"-mod=vendor",
},
"go.testTimeout": "40s"
"go.testTimeout": "40s",
"files.watcherExclude": {
"**/go-coap/v3/**": true
}
}
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![contributors](https://img.shields.io/github/contributors/plgd-dev/go-coap)](https://github.com/plgd-dev/go-coap/graphs/contributors)
[![GitHub stars](https://img.shields.io/github/stars/plgd-dev/go-coap)](https://github.com/plgd-dev/go-coap/stargazers)
[![GitHub license](https://img.shields.io/github/license/plgd-dev/go-coap)](https://github.com/plgd-dev/go-coap/blob/master/LICENSE)
[![GoDoc](https://pkg.go.dev/badge/github.com/plgd-dev/go-coap/v2?utm_source=godoc)](https://pkg.go.dev/github.com/plgd-dev/go-coap/v2?utm_source=godoc)
[![GoDoc](https://pkg.go.dev/badge/github.com/plgd-dev/go-coap/v3?utm_source=godoc)](https://pkg.go.dev/github.com/plgd-dev/go-coap/v3?utm_source=godoc)
<!-- [![Go Report](https://goreportcard.com/badge/github.com/plgd-dev/go-coap)](https://goreportcard.com/report/github.com/plgd-dev/go-coap) -->

The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained networks in the Internet of Things.
Expand Down Expand Up @@ -36,6 +36,10 @@ The go-coap provides servers and clients for DTLS, TCP-TLS, UDP, TCP in golang l
[pion-dtls]: https://github.com/pion/dtls
[coap-429]: https://datatracker.ietf.org/doc/html/rfc8516

## Requirements

* Go 1.18 or higher

## Samples

### Simple
Expand All @@ -48,7 +52,7 @@ The go-coap provides servers and clients for DTLS, TCP-TLS, UDP, TCP in golang l
// Middleware function, which will be called for each request.
func loggingMiddleware(next mux.Handler) mux.Handler {
return mux.HandlerFunc(func(w mux.ResponseWriter, r *mux.Message) {
log.Printf("ClientAddress %v, %v\n", w.Client().RemoteAddr(), r.String())
log.Printf("ClientAddress %v, %v\n", w.Conn().RemoteAddr(), r.String())
next.ServeCOAP(w, r)
})
}
Expand Down
Loading