Commit 435a1e4
refactor: decouple mongodb driver from root module (#222)
* refactor: decouple mongodb driver from root module
* fixes #91
* relates to #191
Drop go.mongodb.org/mongo-driver/v2 from the root go.mod by introducing
an internal minimal BSON codec (bsonlite) that is wire-compatible with
mongo-driver v2.5.0. Users who want the real driver can opt in with a
blank import: `import _ "github.com/go-openapi/strfmt/enable/mongodb"`.
- internal/bsonlite: minimal BSON encoder/decoder for string, DateTime,
ObjectID document types (no external dependencies)
- enable/mongodb: separate Go module that replaces the lite codec with
the real mongo-driver via init()
- ObjectId type changed from bsonprim.ObjectID to [12]byte (same
underlying type, backward compatible)
- All BSON marshal/unmarshal methods rewritten to use bsonlite.C interface
- Convert to mono-repo: go.work, CI workflows switched to monorepo
variants (ci-workflows v0.2.13), dependabot scans all modules
- Integration tests verify both codec paths against real MongoDB
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* fix(ci): use stable Go for integration tests
The go.mod directive (go 1.24) causes setup-go to install go1.24.0,
which triggers a panic in testify/v2 goroutine leak detector init().
Use go-version: stable (go1.26) until testify is patched.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
---------
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 7304ce1 commit 435a1e4
File tree
32 files changed
+1148
-788
lines changed- .github
- workflows
- docs
- enable/mongodb
- internal
- bsonlite
- testintegration
- mongodb_enabled
- mongodb
- mongotest
32 files changed
+1148
-788
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 18 | | |
25 | 19 | | |
26 | 20 | | |
| |||
36 | 30 | | |
37 | 31 | | |
38 | 32 | | |
39 | | - | |
| 33 | + | |
| 34 | + | |
40 | 35 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 36 | + | |
44 | 37 | | |
45 | 38 | | |
46 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
132 | 139 | | |
133 | 140 | | |
134 | 141 | | |
135 | | - | |
136 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| |||
0 commit comments