Refactor platform command api

This commit is contained in:
世界
2023-03-01 10:37:47 +08:00
parent 0ca344df5f
commit 5af8d001ae
11 changed files with 342 additions and 204 deletions

View File

@@ -1,6 +1,10 @@
package libbox
import C "github.com/sagernet/sing-box/constant"
import (
C "github.com/sagernet/sing-box/constant"
"github.com/dustin/go-humanize"
)
func SetBasePath(path string) {
C.SetBasePath(path)
@@ -9,3 +13,7 @@ func SetBasePath(path string) {
func Version() string {
return C.Version
}
func FormatBytes(length int64) string {
return humanize.Bytes(uint64(length))
}