Migrate contentjson and badjson to library &

Add omitempty in format
This commit is contained in:
世界
2023-12-01 20:15:11 +08:00
parent 71960374ff
commit d14c66058d
34 changed files with 35 additions and 494 deletions

View File

@@ -4,8 +4,8 @@ import (
"bytes"
"strings"
"github.com/sagernet/sing-box/common/json"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
)
type _Options struct {

View File

@@ -1,9 +1,9 @@
package option
import (
"github.com/sagernet/sing-box/common/json"
C "github.com/sagernet/sing-box/constant"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
)
type _Inbound struct {

View File

@@ -3,10 +3,10 @@ package option
import (
"bytes"
"github.com/sagernet/sing-box/common/badjson"
"github.com/sagernet/sing-box/common/json"
"github.com/sagernet/sing/common"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
"github.com/sagernet/sing/common/json/badjson"
)
func ToMap(v any) (*badjson.JSONObject, error) {

View File

@@ -1,9 +1,9 @@
package option
import (
"github.com/sagernet/sing-box/common/json"
C "github.com/sagernet/sing-box/constant"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
M "github.com/sagernet/sing/common/metadata"
)

View File

@@ -1,8 +1,8 @@
package option
import (
"github.com/sagernet/sing-box/common/json"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
)
type OnDemandOptions struct {

View File

@@ -3,10 +3,10 @@ package option
import (
"reflect"
"github.com/sagernet/sing-box/common/json"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing/common"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
)
type _Rule struct {

View File

@@ -3,10 +3,10 @@ package option
import (
"reflect"
"github.com/sagernet/sing-box/common/json"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing/common"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
)
type _DNSRule struct {

View File

@@ -3,12 +3,12 @@ package option
import (
"reflect"
"github.com/sagernet/sing-box/common/json"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing/common"
"github.com/sagernet/sing/common/domain"
E "github.com/sagernet/sing/common/exceptions"
F "github.com/sagernet/sing/common/format"
"github.com/sagernet/sing/common/json"
"go4.org/netipx"
)

View File

@@ -1,9 +1,9 @@
package option
import (
"github.com/sagernet/sing-box/common/json"
C "github.com/sagernet/sing-box/constant"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
)
type InboundACMEOptions struct {

View File

@@ -6,10 +6,10 @@ import (
"strings"
"time"
"github.com/sagernet/sing-box/common/json"
"github.com/sagernet/sing-dns"
E "github.com/sagernet/sing/common/exceptions"
F "github.com/sagernet/sing/common/format"
"github.com/sagernet/sing/common/json"
N "github.com/sagernet/sing/common/network"
mDNS "github.com/miekg/dns"

View File

@@ -1,7 +1,7 @@
package option
import (
"github.com/sagernet/sing-box/common/json"
"github.com/sagernet/sing/common/json"
"github.com/sagernet/sing/common/uot"
)

View File

@@ -1,9 +1,9 @@
package option
import (
"github.com/sagernet/sing-box/common/json"
C "github.com/sagernet/sing-box/constant"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
)
type _V2RayTransportOptions struct {