sing-box/experimental/libbox/config.go

18 lines
389 B
Go
Raw Permalink Normal View History

2023-03-15 14:56:06 +08:00
//go:build linux || darwin
2022-10-25 12:55:00 +08:00
package libbox
import (
"github.com/sagernet/sing-box/option"
E "github.com/sagernet/sing/common/exceptions"
)
func parseConfig(configContent string) (option.Options, error) {
var options option.Options
err := options.UnmarshalJSON([]byte(configContent))
if err != nil {
return option.Options{}, E.Cause(err, "decode config")
}
return options, nil
}