WIP: Rewrite package with napi-go #18

Draft
Sirherobrine23 wants to merge 3 commits from go-napi into main
No description provided.
Sirherobrine23 self-assigned this 2025-04-23 23:39:58 +00:00
Sirherobrine23 added 1 commit 2025-04-23 23:39:58 +00:00
Init go mod
Some checks failed
Test / Test Linux (18.x) (pull_request) Failing after 1m39s
Test / Test Linux (20.x) (pull_request) Failing after 1m39s
Test / Test Linux (21.x) (pull_request) Failing after 1m37s
Test / Test Linux (latest) (pull_request) Failing after 1m38s
6364237045
Sirherobrine23 added this to the v2 project 2025-04-23 23:39:59 +00:00
Sirherobrine23 added 1 commit 2025-04-28 02:34:37 +00:00
Refactor N-API addon and switch binding library
Some checks failed
Test / Test Linux (21.x) (pull_request) Failing after 1m58s
Test / Test Linux (latest) (pull_request) Failing after 2m1s
Test / Test Linux (18.x) (pull_request) Failing after 2m5s
Test / Test Linux (20.x) (pull_request) Failing after 2m4s
21312c7378
Replace the old `addon` package with `wg_addon` and switch the N-API
binding library from `abhisekp/napi-go` to
`Sirherobrine23/napi-go`.

This restructures the code to use `wgctrl` for Linux/Windows in
`wg_addon/wgctrl.go` and stubs a `wireguard-go` based implementation
for other Unix systems in `wg_addon/unix.go`. N-API registration and
common types are now in `wg_addon/addon.go`.

The implementation leverages features of the new N-API library, such as
struct tags for automatic marshalling and simplified async worker
creation.
Sirherobrine23 added 1 commit 2025-04-28 22:28:14 +00:00
Refactor: Simplify wgctrl funcs & update napi-go
Some checks failed
Test / Test Linux (latest) (pull_request) Failing after 1m55s
Test / Test Linux (20.x) (pull_request) Failing after 1m58s
Test / Test Linux (21.x) (pull_request) Failing after 1m55s
Test / Test Linux (18.x) (pull_request) Failing after 1m57s
61dcda8662
Change SetInterface and GetInterface to standard Go functions,
removing direct NAPI handling and async logic from wgctrl.go.

Use napi.GoFuncOf for function registration in addon.go.
Update napi-go dependency to v0.1.2 pre-release.
Some checks failed
Test / Test Linux (latest) (pull_request) Failing after 1m55s
Test / Test Linux (20.x) (pull_request) Failing after 1m58s
Test / Test Linux (21.x) (pull_request) Failing after 1m55s
Test / Test Linux (18.x) (pull_request) Failing after 1m57s
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin go-napi:go-napi
git checkout go-napi
Sign in to join this conversation.
No description provided.