http

package
v0.0.0-...-5ba8ac2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = config.HttpName
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Http

type Http struct {
	Enabled           bool   `json:"enabled" yaml:"enabled"`
	Host              string `json:"host" yaml:"host" env:"HOST"`
	Port              int    `json:"port" yaml:"port" env:"PORT"`
	GinMode           string `json:"ginMode" yaml:"ginMode"`                                               // 针对Gin 框架的模式
	ReadHeaderTimeout int    `json:"readHeaderTimeout" yaml:"readHeaderTimeout" env:"READ_HEADER_TIMEOUT"` // 读取请求头超时时间
	ReadTimeout       int    `json:"readTimeout" yaml:"readTimeout" env:"READ_TIMEOUT"`                    // 读取整个HTTP 的超时时间
	WriteTimeout      int    `json:"writeTimeout" yaml:"writeTimeout" env:"WRITE_TIMEOUT"`                 // 响应的超时时间
	IdleTimeout       int    `json:"idleTimeout" yaml:"idleTimeout" env:"IDLE_TIMEOUT"`                    // 开启Keepalive后,复用TCP 链接的超时时间
	MaxHeaderSize     string `json:"maxHeaderSize" yaml:"maxHeaderSize" env:"MAX_HEADER_SIZE"`             // HEADER 最大大小
	Otlp              bool   `json:"otlp" yaml:"otlp"`                                                     // 是否开启Trace

	ioc.ObjectImpl
	// contains filtered or unexported fields
}

func Get

func Get() *Http

func (*Http) Addr

func (h *Http) Addr() string

func (*Http) Close

func (h *Http) Close(ctx context.Context) error

func (*Http) Init

func (h *Http) Init()

func (*Http) Name

func (h *Http) Name() string

func (*Http) PrettyAddr

func (h *Http) PrettyAddr() string

func (*Http) Priority

func (h *Http) Priority() int

func (*Http) SetRouter

func (h *Http) SetRouter(r http.Handler)

func (*Http) Start

func (h *Http) Start(ctx context.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL