cin

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

Release Version

cin

一个 http 和 websocket 多模块的开发框架。创作主要灵感来源于 yii2 高级模板

特性

  • 数据库版本管理(使用 go-migrate)
  • 数据库ORM(使用xorm)
  • 自动路由
  • 应用模式启动

计划

0.0.0

1.构建 http 和 websocket 自动路由

0.1.0

1.添加 go-migrate 数据库版本管理
2.添加 xorm 作为orm引擎

0.2.0

1.添加 cin 命令行。(可用于创建项目,新增模块)
2.添加定时任务组件模块

Documentation

Index

Constants

View Source
const (
	ComponentWebsocketServer = constants.ComponentWebsocketServer

	// 应用状态:初始化
	ApplicationStatusInit = constants.ApplicationStatusInit
	// 应用状态:开始(启动中)
	ApplicationStatusStart = constants.ApplicationStatusStart
	// 应用状态:即将停止
	ApplicationStatusStop = constants.ApplicationStatusStop

	// websocket server 运行模式:自动处理【推荐】
	// 使用框架内规定的 Handler 或 Controller 自动匹配对应的方法。发送数据必须是规范的数据。
	// 使用该模式依然可以使用 OnMessage 接收数据。但是不能发送数据
	WebsocketServerModeAutoHandler = constants.WebsocketServerModeAutoHandler
	// websocket server 运行模式:自定义处理。
	// 自定义 OnMessage 回调方法发送数据。根据实际需求自定义数据返回
	WebsocketServerModeCustom = constants.WebsocketServerModeCustom

	// 控制器类型:websocket
	ControllerTypeWebsocket = constants.ControllerTypeWebsocket
	// 控制器类型:http
	ControllerTypeHttp = constants.ControllerTypeHttp
)

Variables

View Source
var App = newApplication()

应用全局实例(只需要一个实例即可操作整个应用)

Functions

This section is empty.

Types

type Config

type Config struct {
	models.Config
}

配置类

func NewConfig

func NewConfig() *Config

新建配置

type Controller

type Controller struct {
	controllers.BaseController
}

基础 websocket 处理器

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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