refactor && feat: add plugin system && cobra

This commit is contained in:
sjlleo
2023-09-05 22:18:28 +08:00
parent 9e5cd736c8
commit bb522ed859
20 changed files with 703 additions and 19 deletions

View File

@@ -6,11 +6,11 @@ import (
"testing"
"time"
"github.com/sjlleo/nexttrace-core/trace"
"github.com/sjlleo/nexttrace-core/core"
)
func traceroute() {
var test_config = trace.Config{
var test_config = core.Config{
DestIP: net.IPv4(1, 1, 1, 1),
DestPort: 443,
ParallelRequests: 30,
@@ -19,9 +19,9 @@ func traceroute() {
MaxHops: 30,
TTLInterval: 1 * time.Millisecond,
Timeout: 2 * time.Second,
TraceMethod: trace.ICMPTrace,
TraceMethod: core.ICMPTrace,
}
traceInstance, err := trace.NewTracer(test_config)
traceInstance, err := core.NewTracer(test_config)
if err != nil {
log.Println(err)
return