golang的iris安装_Golang 框架 IRIS 配置组

本文介绍了Golang的Iris框架在配置方面的多种选项,包括WithoutServerError、WithoutStartupLog、WithoutInterruptHandler等,这些配置可以影响应用的错误处理、启动日志、中断处理以及路径修正等行为。此外,还提到了WithTimeFormat、WithCharset和WithRemoteAddrHeader等功能,用于设置时间格式、字符集和客户端IP验证。
摘要由CSDN通过智能技术生成

// WithoutServerError将忽略错误,来自主应用程序的`Run`函数。// 用法:// err:= app.Run(iris.Addr(":8080"),iris.WithoutServerError(iris.ErrServerClosed))// 如果服务器的错误是`http/iris#ErrServerClosed`,//将返回`nil`。// 也参见`Configuration#IgnoreServerErrors [] string`。

// 示例: https://github.com/kataras/iris/tree/master/_examples/http-listening/listen-addr/omit-server-errorsfunc WithoutServerError(errors ...error) Configurator

//WithoutStartupLog 将关闭第一次运行终端就发送信息var WithoutStartupLog

// WithoutInterruptHandler禁用自动正常服务器关闭,当按下control / cmd + C时var WithoutInterruptHandler

// WithoutPathCorrection禁用PathCorrection设置//参见`配置`var WithoutPathCorrection

// WithoutBodyConsumptionOnUnmarshal禁用BodyConsumptionOnUnmarshal设置//参见`配置`var WithoutBodyConsumptionOnUnmarshal

// WithoutAutoFireStatusCode禁用AutoFireStatusCode设置//参见`配置`var Wi

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值