web

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 17 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

func RestMainWebService added in v0.0.24

func RestMainWebService() *restful.Container

func RestWebService added in v0.0.24

func RestWebService() *restful.WebService

Types

type Code added in v0.0.8

type Code struct {
	Val int
	Msg string
}

type IrisServerStarter

type IrisServerStarter struct {
	infra.BaseStarter
}

func NewBlockIrisServerStarter added in v0.0.20

func NewBlockIrisServerStarter() *IrisServerStarter

func (*IrisServerStarter) Init

func (i *IrisServerStarter) Init(ctx context.Context)

func (*IrisServerStarter) Setup

func (i *IrisServerStarter) Setup(ctx context.Context)

func (*IrisServerStarter) Start

func (i *IrisServerStarter) Start(ctx context.Context)

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"
)

type RestServerStarter added in v0.0.24

type RestServerStarter struct {
	infra.BaseStarter
}

func NewBlockRestServerStarter added in v0.0.24

func NewBlockRestServerStarter() *RestServerStarter

func (*RestServerStarter) Init added in v0.0.24

func (s *RestServerStarter) Init(ctx context.Context)

func (*RestServerStarter) Setup added in v0.0.24

func (s *RestServerStarter) Setup(ctx context.Context)

func (*RestServerStarter) Start added in v0.0.24

func (s *RestServerStarter) Start(ctx context.Context)

func (*RestServerStarter) StartBlocking added in v0.0.24

func (i *RestServerStarter) StartBlocking() bool

func (*RestServerStarter) Stop added in v0.0.24

func (s *RestServerStarter) Stop(ctx context.Context)

Jump to

Keyboard shortcuts

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