 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- type Http
- func (h *Http) Addr() string
- func (h *Http) ApiObjectAddr(obj ioc.Object) string
- func (h *Http) ApiObjectPathPrefix(obj ioc.Object) string
- func (h *Http) HTTPPrefix() string
- func (h *Http) Init() error
- func (h *Http) IsEnable() bool
- func (h *Http) Name() string
- func (i *Http) Priority() int
- func (h *Http) SetRouter(r http.Handler)
- func (h *Http) Start(ctx context.Context)
- func (h *Http) Stop(ctx context.Context) error
- func (a *Http) SwagerDocs(swo *spec.Swagger)
 
Constants ¶
      View Source
      
  
const (
	AppName = "http"
)
    Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Http ¶
type Http struct {
	ioc.ObjectImpl
	// 是否开启HTTP Server, 默认会根据是否有注册得有API对象来自动开启
	Enable *bool `json:"enable" yaml:"enable" toml:"enable" env:"ENABLE"`
	// HTTP服务Host
	Host string `json:"host" yaml:"host" toml:"host" env:"HOST"`
	// HTTP服务端口
	Port int `json:"port" yaml:"port" toml:"port" env:"PORT"`
	// API接口前缀
	PathPrefix string `json:"path_prefix" yaml:"path_prefix" toml:"path_prefix" env:"PATH_PREFIX"`
	// HTTP服务器参数
	// HTTP Header读取超时时间
	ReadHeaderTimeoutSecond int `json:"read_header_timeout" yaml:"read_header_timeout" toml:"read_header_timeout" env:"READ_HEADER_TIMEOUT"`
	// 读取HTTP整个请求时的参数
	ReadTimeoutSecond int `json:"read_timeout" yaml:"read_timeout" toml:"read_timeout" env:"READ_TIMEOUT"`
	// 响应超时时间
	WriteTimeoutSecond int `json:"write_timeout" yaml:"write_timeout" toml:"write_timeout" env:"WRITE_TIMEOUT"`
	// 启用了KeepAlive时 复用TCP链接的超时时间
	IdleTimeoutSecond int `json:"idle_timeout" yaml:"idle_timeout" toml:"idle_timeout" env:"IDLE_TIMEOUT"`
	// header最大大小
	MaxHeaderSize string `json:"max_header_size" yaml:"max_header_size" toml:"max_header_size" env:"MAX_HEADER_SIZE"`
	// contains filtered or unexported fields
}
    func (*Http) ApiObjectPathPrefix ¶ added in v2.0.6
func (*Http) HTTPPrefix ¶
func (*Http) SwagerDocs ¶
 Click to show internal directories. 
   Click to hide internal directories.