gohttp/model/model.go

35 lines
811 B
Go
Raw Normal View History

2023-12-07 00:22:53 +08:00
package model
2023-12-08 22:02:36 +08:00
import "git.pyer.club/kingecg/gologger"
2023-12-07 00:22:53 +08:00
type HttpPath struct {
2023-12-09 16:34:20 +08:00
Path string `json:"path"`
Root string `json:"root"`
Default string `json:"default"`
Upstreams []string `json:"upstreams"`
Rewrite PathRewrite `json:"pathrewrite"`
}
type PathRewrite struct {
Replace string `json:"replace"`
With string `json:"with"`
2023-12-07 00:22:53 +08:00
}
type HttpServerConfig struct {
ServerName string `json:"server"`
Port int `json:"port"`
Host string `json:"host"`
Paths []HttpPath
}
type GoHttpdConfig struct {
2023-12-08 22:02:36 +08:00
Logging gologger.LoggersConfig `json:"logging"`
Admin *HttpServerConfig `json:"admin"`
Servers []*HttpServerConfig `json:"servers"`
2023-12-07 00:22:53 +08:00
}
var DefaultAdminConfig HttpServerConfig = HttpServerConfig{
ServerName: "admin",
Port: 8080,
}