feat(transport): add SetTransportInstance function to allow setting the transport instance
All checks were successful
Go Build Test / Build (darwin, amd64) (pull_request) Successful in 38s
Go Build Test / Build (freebsd, arm) (pull_request) Successful in 35s
Bearer / scan (pull_request) Successful in 40s
Go Build Test / Build (linux, amd64) (pull_request) Successful in 37s
Go Build Test / Build (darwin, arm64) (pull_request) Successful in 41s
Go Build Test / Build (freebsd, arm64) (pull_request) Successful in 42s
Go Build Test / Build (windows, arm64) (pull_request) Successful in 38s
Go Build Test / Build (linux, arm64) (pull_request) Successful in 41s
Go Build Test / Build (js, wasm) (pull_request) Successful in 31s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (pull_request) Successful in 1m20s
Go Revive Lint / lint (pull_request) Successful in 57s
Run Gosec / tests (pull_request) Successful in 1m29s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (pull_request) Successful in 2m52s
Go Build Test / Build (linux, arm) (pull_request) Successful in 9m26s
Go Build Test / Build (windows, amd64) (pull_request) Successful in 9m28s
Go Benchmarks / Run Benchmarks (pull_request) Successful in 9m48s
Go Build Test / Build (windows, arm) (pull_request) Successful in 9m24s
Go Build Test / Build (freebsd, amd64) (pull_request) Successful in 9m30s

This commit is contained in:
2026-01-02 17:57:29 -06:00
parent 41bcb65e16
commit 4e3e1b9104

View File

@@ -323,6 +323,12 @@ func GetTransportInstance() *Transport {
return transportInstance
}
func SetTransportInstance(t *Transport) {
transportMutex.Lock()
defer transportMutex.Unlock()
transportInstance = t
}
func (t *Transport) RegisterInterface(name string, iface common.NetworkInterface) error {
t.mutex.Lock()
defer t.mutex.Unlock()