Initial commit

This commit is contained in:
Yuzuki616
2024-09-12 06:04:32 +09:00
commit 3f58fa7f0d
31 changed files with 2814 additions and 0 deletions

22
conf/core.go Normal file
View File

@@ -0,0 +1,22 @@
package conf
import "github.com/goccy/go-json"
type Core struct {
Name string `json:"Name,omitempty"`
Path string `json:"Path,omitempty"`
DataPath string `json:"DataPath,omitempty"`
Config json.RawMessage `json:"Config,omitempty"`
}
type _core Core
func (c *Core) UnmarshalJSON(data []byte) error {
err := json.Unmarshal(data, (*_core)(c))
if err != nil {
return err
}
if len(c.Config) == 0 {
c.Config = data
}
return nil
}