mux

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

* @Description: 用于开启一个 http 服务 * @Params: 可变参数, 可以指定端口号, 服务名称, * @Author: LenLee * @Date: 2022-06-24 21:59:45 * @LastEditTime: 2024-03-27 04:46:10 * @LastEditors: reel * @FilePath:

* @Author: reel * @Date: 2023-05-12 06:40:04 * @LastEditors: reel * @LastEditTime: 2023-05-23 07:36:45 * @Description: http服务配置选项

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mux

type Mux interface {
	Name() string
	Status() int8
	Start() error
	Stop() error
	Engine() *gin.Engine
	SetAddr(addr string)
	AddStartJobList(...StartJobFunc)
}

func New

func New(optF ...OptFunc) (srv Mux, err error)

type OptFunc

type OptFunc func(*opts)

func SetHost

func SetHost(addr string) OptFunc

设置监听地址

func SetMaxHeaderSize

func SetMaxHeaderSize(maxHeaderSize int) OptFunc

设置请求头最大字节

func SetMaxReadTime

func SetMaxReadTime(maxReadTime time.Duration) OptFunc

设置最大访问时间

func SetMaxWriteTIme

func SetMaxWriteTIme(maxWriteTIme time.Duration) OptFunc

设置最大写入时间

func SetMode

func SetMode(mode string) OptFunc

启动模式

func SetName

func SetName(name string) OptFunc

设置服务名称

func SetTimeout

func SetTimeout(timeout int) OptFunc

设置关机最大停留时间

type StartJobFunc added in v1.1.0

type StartJobFunc func() error

Jump to

Keyboard shortcuts

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