new: add cli interface with basic webui

This commit is contained in:
Hiddify
2024-03-09 15:49:09 +01:00
parent f9e6f022c8
commit 3a82650759
27 changed files with 433 additions and 222 deletions

View File

@@ -1,4 +1,4 @@
package main
package cmd
import (
"encoding/json"
@@ -109,6 +109,15 @@ func readConfigAt(path string) (*option.Options, error) {
return &options, nil
}
func readConfigBytes(content []byte) (*option.Options, error) {
var options option.Options
err := options.UnmarshalJSON(content)
if err != nil {
return nil, err
}
return &options, nil
}
func readConfigOptionsAt(path string) (*config.ConfigOptions, error) {
content, err := os.ReadFile(path)
if err != nil {