mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-25 18:11:28 +00:00
18 lines
389 B
Go
18 lines
389 B
Go
//go:build linux || darwin
|
|
|
|
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
|
|
}
|