restructure

This commit is contained in:
yanghao05
2023-04-20 12:11:34 +08:00
parent 6757e00d73
commit 5b8eca5d87
120 changed files with 546 additions and 7303 deletions

34
providers/http/config.go Normal file
View File

@@ -0,0 +1,34 @@
package http
import (
"fmt"
)
type Config struct {
Static string
Host string
Port uint
Https bool
HttpsCert string
HttpKey string
Cors struct {
Mode string
Whitelist []Whitelist
}
}
type Whitelist struct {
AllowOrigin string
AllowHeaders string
AllowMethods string
ExposeHeaders string
AllowCredentials bool
}
func (h *Config) Address() string {
return fmt.Sprintf("%s:%d", h.Host, h.Port)
}
func (h *Config) PortString() string {
return fmt.Sprintf(":%d", h.Port)
}