MCPcopy Create free account
hub / github.com/Monibuca/engine / HTTP

Struct HTTP

config/http.go:18–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17type Middleware func(string, http.Handler) http.Handler
18type HTTP struct {
19 ListenAddr string `desc:"监听地址"`
20 ListenAddrTLS string `desc:"监听地址HTTPS"`
21 CertFile string `desc:"HTTPS证书文件"`
22 KeyFile string `desc:"HTTPS密钥文件"`
23 CORS bool `default:"true" desc:"是否自动添加CORS头"` //是否自动添加CORS头
24 UserName string `desc:"基本身份认证用户名"`
25 Password string `desc:"基本身份认证密码"`
26 ReadTimeout time.Duration `desc:"读取超时"`
27 WriteTimeout time.Duration `desc:"写入超时"`
28 IdleTimeout time.Duration `desc:"空闲超时"`
29 mux *http.ServeMux
30 middlewares []Middleware
31}
32type HTTPConfig interface {
33 GetHTTPConfig() *HTTP
34 Listen(ctx context.Context) error

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected