feat: add Go SDK package (REST client + VL1 agent + TAP device)

This commit is contained in:
xieyao
2026-06-17 03:59:45 +08:00
parent ee5f036325
commit e3147ac06f
6 changed files with 1175 additions and 0 deletions

26
sdk/tap_stub.go Normal file
View File

@@ -0,0 +1,26 @@
//go:build !linux
package sdk
import "fmt"
type tapInterface struct {
Name string
MTU int
}
func openTap(name string, mtu int) (*tapInterface, error) {
return nil, fmt.Errorf("TAP device requires Linux")
}
func (ti *tapInterface) Read(buf []byte) (int, error) {
return 0, fmt.Errorf("not supported")
}
func (ti *tapInterface) Write(buf []byte) error {
return fmt.Errorf("not supported")
}
func (ti *tapInterface) Close() error {
return nil
}