This commit is contained in:
rogeecn
2025-03-22 16:39:52 +08:00
commit 306491168c
127 changed files with 17865 additions and 0 deletions

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

@@ -0,0 +1,38 @@
package http
import (
"fmt"
)
const DefaultPrefix = "Http"
type Config struct {
StaticPath *string
StaticRoute *string
BaseURI *string
Port uint
Tls *Tls
Cors *Cors
}
type Tls struct {
Cert string
Key string
}
type 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(":%d", h.Port)
}