web

package
v0.0.11-grpc-test Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

Iris Starter

分两个阶段

初始化阶段

  • 创建iris application 实例
  • iris 日志组件配置和扩展
  • 主要中间件的配置: recover中间件和自定义日志中间件

启动阶段

  • 把系统注册的路由信息打印到控制台,方便查看
  • 从配置中读取配置的端口,启动iris web服务监听端口

定义为可阻塞的starter,所以是整个配置的最后一个

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IrisApp

func IrisApp() *iris.Application

func IrisMainParty

func IrisMainParty() iris.Party

Types

type Code added in v0.0.8

type Code struct {
	Val int
	Msg string
}

type IrisServerStarter

type IrisServerStarter struct {
	infra.BaseStarter
}

func (*IrisServerStarter) Init

func (i *IrisServerStarter) Init(ctx infra.StarterContext)

func (*IrisServerStarter) Setup

func (i *IrisServerStarter) Setup(ctx infra.StarterContext)

func (*IrisServerStarter) Start

func (i *IrisServerStarter) Start(ctx infra.StarterContext)

func (*IrisServerStarter) StartBlocking

func (i *IrisServerStarter) StartBlocking() bool

type Res added in v0.0.8

type Res struct {
	Code    ResCode     `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type ResCode added in v0.0.8

type ResCode string
const (
	ResCodeOk                 ResCode = "0"
	ResCodeValidationError    ResCode = "2000"
	ResCodeRequestParamsError ResCode = "2100"
	ResCodeInnerServerError   ResCode = "5000"
	ResCodeBizError           ResCode = "6000"
)

Jump to

Keyboard shortcuts

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