-
Notifications
You must be signed in to change notification settings - Fork 24
/
config.go
30 lines (24 loc) · 797 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package service
import "github.com/Potterli20/trojan-go-fork/config"
const Name = "API_SERVICE"
type SSLConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
CertPath string `json:"cert" yaml:"cert"`
KeyPath string `json:"key" yaml:"key"`
VerifyClient bool `json:"verify_client" yaml:"verify-client"`
ClientCertPath []string `json:"client_cert" yaml:"client-cert"`
}
type APIConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
APIHost string `json:"api_addr" yaml:"api-addr"`
APIPort int `json:"api_port" yaml:"api-port"`
SSL SSLConfig `json:"ssl" yaml:"ssl"`
}
type Config struct {
API APIConfig `json:"api" yaml:"api"`
}
func init() {
config.RegisterConfigCreator(Name, func() any {
return new(Config)
})
}