Restructure and add library target (#394)

* move config (clap) structs into config.rs

- copied all config structs into config.rs, along with all `use`
statements
- made everything `pub`
- changed main.rs to import these structs

* remove unused imports and move parsing tests to config.rs

* cargo fmt

* separate library and cli

- make root package a cargo workspace
- move code to start client/server tunnels into lib.rs
- move rest of main.rs into wstunnel-cli bin package
- move "Wstunnel" config struct into bin package
  - the fields here are only applicable to the CLI

* cargo fmt

* move clap parsing into feature

* move argument parsing functions under clap feature

* update wstunnel-cli binary name and build workflow

* cargo fmt, fix tests

* update build instructions

* only use required tokio features
This commit is contained in:
Siddhant Kameswar
2025-01-06 06:32:54 -06:00
committed by GitHub
parent 92ec4a9479
commit 3fa806dc24
10 changed files with 1381 additions and 1272 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ jobs:
with:
command: build
use-cross: ${{ !contains(matrix.platform.target, 'x86_64') || contains(matrix.platform.target, 'freebsd') }}
args: ${{ matrix.platform.build-args }} --target ${{ matrix.platform.target }}
args: ${{ matrix.platform.build-args }} --package wstunnel-cli --target ${{ matrix.platform.target }}
- name: Store artifact
uses: actions/upload-artifact@v4