types

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface{}

Component 组件类型

type Database

type Database interface {
	Connect() (db.Session, error)
}

type Engine

type Engine interface {
	// App iris应用
	App() *iris.Application
	// Set 注册实例
	Set(name string, component Component)
	// SetPostMemory 设置POST最大内存
	SetPostMemory(memory int64)
	// Get 返回实例
	Get(name string) Component
	// Reset 重置配置
	Reset(func(c *config.Config))
	// Config 配置信息
	Config() *config.Config
	// Plugin 注册插件
	Plugin(name string, plugin PluginHandler)
	// Worker 注册工作协程
	Worker(name string, plugin Worker)
	// Module 注册模块
	Module(party string, module Module)
	// Middleware 注册通用中间件
	Middleware(handler MiddlewareHandler)
	// RouteMiddleware 路由中间件
	RouteMiddleware(middleware MiddlewareHandler)
	// IfMiddleware 注册条件中间件
	IfMiddleware(mode string, middleware MiddlewareHandler)
	// IfRouteMiddleware 注册路由条件中间件
	IfRouteMiddleware(mode string, middleware MiddlewareHandler)
	// Stop 停止服务
	Stop() error
	// Implement 自定义业务
	Implement(func() error)
	// Defer 延迟函数
	Defer(f func())
	// IsDev 是否开发环境
	IsDev() bool
	// Run 运行程序
	Run(file string) error
	// Test 执行测试
	Test(file string) error
	// Parse 解析配置
	Parse(file string, out interface{}) error
}

Engine 应用引擎

type Middleware

type Middleware struct {
	// 是否路由中间件
	Route bool
	// 中间件处理
	Handler MiddlewareHandler
}

Middleware 中间件

type MiddlewareHandler

type MiddlewareHandler func(Engine) iris.Handler

MiddlewareHandler 中间件处理

type Module

type Module func(*mvc.Application)

Module 模块函数

type Plugin

type Plugin struct {
	// 插件名称
	Name string
	// 插件函数
	Handler PluginHandler
}

Plugin 插件结构

type PluginHandler

type PluginHandler func(string, Engine) error

PluginHandler 插件函数

type Worker

type Worker func(string, Engine)

Worker 工作协程

Jump to

Keyboard shortcuts

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