Help us shape the future of Go! Take the 2026 Go Developer Survey

gou

package module
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: Apache-2.0 Imports: 62 Imported by: 0

README

Gou Framework

Unit-Test codecov Go Report Card Go Reference

App engine framework

Gou 来自易经姤卦。《象》曰: 天下有风,姤。后以施命诰四方。

Discord: https://discord.gg/MJMQCJ2Q

Documentation: https://yaoapps.com/en-US/doc

Documentation

Index

Constants

View Source
const (
	RelHasOne         = "hasOne"         // 1 v 1
	RelHasMany        = "hasMany"        // 1 v n
	RelBelongsTo      = "belongsTo"      // inverse  1 v 1 / 1 v n / n v n
	RelHasOneThrough  = "hasOneThrough"  // 1 v 1 ( t1 <-> t2 <-> t3)
	RelHasManyThrough = "hasManyThrough" // 1 v n ( t1 <-> t2 <-> t3)
	RelBelongsToMany  = "belongsToMany"  // 1 v1 / 1 v n / n v n
	RelMorphOne       = "morphOne"
	RelMorphMany      = "morphMany"
	RelMorphToMany    = "morphToMany"
	RelMorphByMany    = "morphByMany"
	RelMorphMap       = "morphMap"
)

Relationship types

Variables

View Source
var APIs = map[string]*API{}

APIs 已加载API列表

View Source
var Encryptors = map[string]Encryptor{}

Encryptors 已加载加密器

View Source
var FileSystemHandlers = map[string]ProcessHandler{
	"readfile":        processReadFile,
	"readfilebuffer":  processReadFileBuffer,
	"writefile":       processWirteFile,
	"writefilebuffer": processWriteFileBuffer,
	"readdir":         processReadDir,
	"mkdir":           processMkdir,
	"mkdirall":        processMkdirAll,
	"mkdirtemp":       processMkdirTemp,
	"remove":          processRemove,
	"removeall":       processRemoveAll,
	"exists":          processExists,
	"isdir":           processIsDir,
	"isfile":          processIsFile,
	"islink":          processIsLink,
	"chmod":           processChmod,
	"size":            processSize,
	"mode":            processMode,
	"modtime":         processModTime,
	"basename":        processBaseName,
	"dirname":         processDirName,
	"extname":         processExtName,
	"mimetype":        processMimeType,
	"move":            processMove,
	"copy":            processCopy,
	"upload":          processUpload,
	"download":        processDownload,
}

FileSystemHandlers the file system handlers

View Source
var Flows = map[string]*Flow{}

Flows 已加载工作流列表

View Source
var HTTPGuards = map[string]gin.HandlerFunc{}

HTTPGuards 支持的中间件

View Source
var HTTPHandlers = map[string]ProcessHandler{
	"get":    processHTTPGet,
	"post":   processHTTPPost,
	"put":    processHTTPPut,
	"patch":  processHTTPPatch,
	"delete": processHTTPDelete,
	"head":   processHTTPHead,
	"send":   processHTTPSend,
}

HTTPHandlers the http handlers

View Source
var HandlerGroups = map[string]map[string]ProcessHandler{}

HandlerGroups registered process handler groups

View Source
var IEncryptors = map[string]IEncryptor{
	"AES":      &EncryptorAES{},
	"PASSWORD": &EncryptorPassword{},
}

IEncryptors 加密码器接口映射

View Source
var ModelHandlers = map[string]ProcessHandler{
	"find":                processFind,
	"get":                 processGet,
	"paginate":            processPaginate,
	"selectoption":        processSelectOption,
	"create":              processCreate,
	"update":              processUpdate,
	"save":                processSave,
	"delete":              processDelete,
	"destroy":             processDestroy,
	"insert":              processInsert,
	"updatewhere":         processUpdateWhere,
	"deletewhere":         processDeleteWhere,
	"destroywhere":        processDestroyWhere,
	"eachsave":            processEachSave,
	"eachsaveafterdelete": processEachSaveAfterDelete,
}

ModelHandlers 模型运行器

View Source
var Models = map[string]*Model{}

Models 已载入模型

View Source
var Plugins = map[string]*Plugin{}

Plugins 已加载插件

View Source
var ScheduleHandlers = map[string]ProcessHandler{
	"start": processScheduleStart,
	"stop":  processScheduleStop,
}

ScheduleHandlers chedule process handlers

View Source
var Schedules = map[string]*Schedule{}

Schedules the registered schedules

View Source
var SchemaHandlers = map[string]ProcessHandler{
	"create": processSchemaCreate,
	"drop":   processSchemaDrop,

	"tables":      processSchemaTables,
	"tableget":    processSchemaTableGet,
	"tablecreate": processSchemaTableCreate,
	"tabledrop":   processSchemaTableDrop,
	"tablerename": processSchemaTableRename,
	"tablediff":   processSchemaTableDiff,
	"tablesave":   processSchemaTableSave,

	"columnadd": processSchemaColumnAdd,
	"columnalt": processSchemaColumnAlt,
	"columndel": processSchemaColumnDel,

	"indexadd": processSchemaIndexAdd,
	"indexdel": processSchemaIndexDel,
}

SchemaHandlers Processes

View Source
var Services = map[string]*service.Service{}

Services services loaded (Alpha)

View Source
var Sockets = map[string]*Socket{}

Sockets sockets loaded (Alpha)

View Source
var StoreHandlers = map[string]ProcessHandler{
	"get":    processStoreGet,
	"set":    processStoreSet,
	"has":    processStoreHas,
	"del":    processStoreDel,
	"getdel": processStoreGetDel,
	"len":    processStoreLen,
	"keys":   processStoreKeys,
	"clear":  processStoreClear,
}

StoreHandlers store process handlers

View Source
var TaskHandlers = map[string]ProcessHandler{
	"add":      processTaskAdd,
	"progress": processTaskProgress,
	"get":      processTaskGet,
}

TaskHandlers task process handlers

View Source
var ThirdHandlers = map[string]ProcessHandler{}

ThirdHandlers 第三方处理器

View Source
var Validations = map[string]func(value interface{}, row maps.MapStrAny, args ...interface{}) bool{
	"typof":     ValidationTypeof,
	"min":       ValidationMin,
	"max":       ValidationMax,
	"enum":      ValidationEnum,
	"pattern":   ValidationPattern,
	"minLength": ValidationMinLength,
	"maxLength": ValidationMaxLength,
	"email":     ValidationEmail,
	"mobile":    ValidationMobile,
}

Validations 数据校验函数

View Source
var WebSockets = map[string]*WebSocket{}

WebSockets websockets loaded (Alpha)

View Source
var WidgetCustomHandlers = map[string]map[string]ProcessHandler{}

WidgetCustomHandlers custom widget handlers

View Source
var WidgetHandlers = map[string]ProcessHandler{
	"reload": processReloadWidgetInstance,
}

WidgetHandlers widget process handlers

Yao JavaScript 运行环境

Functions

func AddHTTPGuard

func AddHTTPGuard(name string, guard gin.HandlerFunc)

AddHTTPGuard 添加中间件

func AliasProcess

func AliasProcess(name string, alias string)

AliasProcess 设置别名

func EnvInt

func EnvInt(key interface{}, defaults ...int) int

EnvInt replace $ENV.xxx with the env and cast to the integer

func EnvString

func EnvString(key interface{}, defaults ...string) string

EnvString replace $ENV.xxx with the env

func IsAllowed

func IsAllowed(c *gin.Context, allowsMap map[string]bool) bool

IsAllowed check if the referer is in allow list

func KillPlugins

func KillPlugins()

KillPlugins 关闭插件进程

func LoadRuntime added in v0.10.2

func LoadRuntime(option runtime.Option)

LoadRuntime load runtime

func LoadService

func LoadService(source string, name string) (*service.Service, error)

LoadService load socket server/client

func LoadStore

func LoadStore(source string, name string) (store.Store, error)

LoadStore load kv store

func LoadTask

func LoadTask(source string, name string) (*task.Task, error)

LoadTask load task

func LoadWebSocketServer

func LoadWebSocketServer(source string, name string) (*websocket.Upgrader, error)

LoadWebSocketServer load websocket servers

func LoadWidget

func LoadWidget(path string, name string, register widget.ModuleRegister) (*widget.Widget, error)

LoadWidget load widgets

func ProcessGuard

func ProcessGuard(name string) gin.HandlerFunc

ProcessGuard guard process

func RegisterProcessGroup added in v0.10.2

func RegisterProcessGroup(name string, group map[string]ProcessHandler)

RegisterProcessGroup register a process handler group

func RegisterProcessHandler

func RegisterProcessHandler(name string, handler ProcessHandler)

RegisterProcessHandler 注册 ProcessHandler

func SelectPluginModel

func SelectPluginModel(name string) grpc.Model

SelectPluginModel 选择插件

func SelectService

func SelectService(name string) *service.Service

SelectService Get socket by name

func SelectStore

func SelectStore(name string) store.Store

SelectStore Select loaded kv store

func SelectTask

func SelectTask(name string) *task.Task

SelectTask select task by name

func SelectWebSocketServer

func SelectWebSocketServer(name string) *websocket.Upgrader

SelectWebSocketServer Get WebSocket server by name

func ServeHTTP

func ServeHTTP(server Server, shutdown chan bool, onShutdown func(Server), middlewares ...gin.HandlerFunc)

ServeHTTP Start the http server

func ServeHTTPCustomRouter

func ServeHTTPCustomRouter(router *gin.Engine, server Server, shutdown chan bool, onShutdown func(Server), middlewares ...gin.HandlerFunc)

ServeHTTPCustomRouter Start the cumtom http server

func SetFileRoot added in v0.10.2

func SetFileRoot(root string) error

SetFileRoot SetFileRoot

func SetHTTPGuards

func SetHTTPGuards(guards map[string]gin.HandlerFunc)

SetHTTPGuards 加载中间件

func SetHTTPRoutes

func SetHTTPRoutes(router *gin.Engine, server Server, middlewares ...gin.HandlerFunc)

SetHTTPRoutes 设定路由

func SetModelLogger

func SetModelLogger(output io.Writer, level log.Level)

SetModelLogger 设定模型 Logger

func SetPluginLogger

func SetPluginLogger(name string, output io.Writer, level hclog.Level)

SetPluginLogger 设置日志

func ValidationEmail

func ValidationEmail(value interface{}, _ maps.MapStrAny, _ ...interface{}) bool

ValidationEmail 验证邮箱

func ValidationEnum

func ValidationEnum(value interface{}, _ maps.MapStrAny, args ...interface{}) bool

ValidationEnum 枚举型

func ValidationMax

func ValidationMax(value interface{}, _ maps.MapStrAny, args ...interface{}) bool

ValidationMax 最大值

func ValidationMaxLength

func ValidationMaxLength(value interface{}, _ maps.MapStrAny, args ...interface{}) bool

ValidationMaxLength 最大长度

func ValidationMin

func ValidationMin(value interface{}, _ maps.MapStrAny, args ...interface{}) bool

ValidationMin 最小值

func ValidationMinLength

func ValidationMinLength(value interface{}, _ maps.MapStrAny, args ...interface{}) bool

ValidationMinLength 最小长度

func ValidationMobile

func ValidationMobile(value interface{}, _ maps.MapStrAny, args ...interface{}) bool

ValidationMobile 验证手机号

func ValidationPattern

func ValidationPattern(value interface{}, _ maps.MapStrAny, args ...interface{}) bool

ValidationPattern 正则匹配

func ValidationTypeof

func ValidationTypeof(value interface{}, _ maps.MapStrAny, args ...interface{}) bool

ValidationTypeof 校验数值类型

Types

type API

type API struct {
	ID     string `jsong:"id"`
	Name   string
	Source string
	Type   string
	HTTP   HTTP
}

API 数据接口

func LoadAPI

func LoadAPI(source string, id string, guard ...string) *API

LoadAPI 加载API

func LoadAPIReturn

func LoadAPIReturn(source string, id string, guard ...string) (api *API, err error)

LoadAPIReturn 加载API

func SelectAPI

func SelectAPI(id string) *API

SelectAPI 读取已加载API

func (*API) Reload

func (api *API) Reload() *API

Reload 重新载入API

type Column

type Column struct {
	Label       string       `json:"label,omitempty"`
	Name        string       `json:"name"`
	Type        string       `json:"type,omitempty"`
	Title       string       `json:"title,omitempty"`
	Description string       `json:"description,omitempty"`
	Comment     string       `json:"comment,omitempty"`
	Length      int          `json:"length,omitempty"`
	Precision   int          `json:"precision,omitempty"`
	Scale       int          `json:"scale,omitempty"`
	Nullable    bool         `json:"nullable,omitempty"`
	Option      []string     `json:"option,omitempty"`
	Default     interface{}  `json:"default,omitempty"`
	DefaultRaw  string       `json:"default_raw,omitempty"`
	Example     interface{}  `json:"example,omitempty"`
	Generate    string       `json:"generate,omitempty"` // Increment, UUID,...
	Crypt       string       `json:"crypt,omitempty"`    // AES, PASSWORD, AES-256, AES-128, PASSWORD-HASH, ...
	Validations []Validation `json:"validations,omitempty"`
	Index       bool         `json:"index,omitempty"`
	Unique      bool         `json:"unique,omitempty"`
	Primary     bool         `json:"primary,omitempty"`
	// contains filtered or unexported fields
}

Column the field description struct

func (*Column) FliterIn

func (column *Column) FliterIn(value interface{}, row maps.MapStrAny)

FliterIn 输入过滤器

func (*Column) FliterOut

func (column *Column) FliterOut(value interface{}, row maps.MapStrAny, export ...string)

FliterOut 输出过滤器

func (*Column) Map

func (column *Column) Map() map[string]interface{}

Map 转换为Map

func (Column) SetOption

func (column Column) SetOption(col *schema.Column)

SetOption 设置字段选项

func (Column) SetType

func (column Column) SetType(table schema.Blueprint) *schema.Column

SetType 设置字段类型

func (*Column) Validate

func (column *Column) Validate(value interface{}, row maps.MapStrAny) (bool, []string)

Validate 数值有效性验证

type ColumnMap

type ColumnMap struct {
	Column *Column
	Model  *Model
	Export string // 取值时的变量名
}

ColumnMap ColumnMap 字段映射

type Encryptor

type Encryptor struct {
	Name   string `json:"-"`                // 名称
	Source string `json:"-"`                // 来源
	Salt   string `json:"salt,omitempty"`   // 盐
	Key    string `json:"key,omitempty"`    // 钥匙
	Secret string `json:"secret,omitempty"` // 密钥
}

Encryptor 加密器

func LoadCrypt

func LoadCrypt(source string, name string) Encryptor

LoadCrypt 载入数据模型

type EncryptorAES

type EncryptorAES struct{ Encryptor }

EncryptorAES AES

func (EncryptorAES) Decode

func (aes EncryptorAES) Decode(field string) (string, error)

Decode AES Decode

func (EncryptorAES) Encode

func (aes EncryptorAES) Encode(value string) (string, error)

Encode AES Encode

func (*EncryptorAES) Set

func (aes *EncryptorAES) Set(crypt Encryptor)

Set AES Encode

func (EncryptorAES) Validate

func (aes EncryptorAES) Validate(hash string, field string) bool

Validate AES Decode

type EncryptorAES128

type EncryptorAES128 struct{ Encryptor }

EncryptorAES128 AES 128

type EncryptorAES256

type EncryptorAES256 struct{ Encryptor }

EncryptorAES256 AES 256

type EncryptorPassword

type EncryptorPassword struct{ Encryptor }

EncryptorPassword 密码加密

func (EncryptorPassword) Decode

func (pwd EncryptorPassword) Decode(value string) (string, error)

Decode PASSWORD Decode

func (EncryptorPassword) Encode

func (pwd EncryptorPassword) Encode(value string) (string, error)

Encode PASSWORD Encode

func (*EncryptorPassword) Set

func (pwd *EncryptorPassword) Set(crypt Encryptor)

Set AES Encode

func (EncryptorPassword) Validate

func (pwd EncryptorPassword) Validate(hash string, value string) bool

Validate PASSWORD Decode

type ErrorOfImport

type ErrorOfImport struct {
	Code    int         `json:"code"`            // 错误码
	Message string      `json:"message"`         // 错误描述
	File    string      `json:"file"`            // 出错文件
	Line    int         `json:"line,omitempty"`  // 出错行
	Field   string      `json:"field,omitempty"` // 源数据出错字段名称
	Value   interface{} `json:"value,omitempty"` // 源数据出错数值
}

ErrorOfImport 导入错误结构体

func (*ErrorOfImport) AtLine

func (err *ErrorOfImport) AtLine(line int) *ErrorOfImport

AtLine 设置出错行

func (*ErrorOfImport) FieldIs

func (err *ErrorOfImport) FieldIs(name string) *ErrorOfImport

FieldIs 设置出错字段

func (*ErrorOfImport) FileIs

func (err *ErrorOfImport) FileIs(filename string) *ErrorOfImport

FileIs 设置出错文件

func (*ErrorOfImport) ValueIs

func (err *ErrorOfImport) ValueIs(value interface{}) *ErrorOfImport

ValueIs 设置出错字段

type ErrorsImport

type ErrorsImport []*ErrorOfImport

ErrorsImport 导入错误集合

type ExportData

type ExportData struct {
	Model   string          `json:"model"`
	Columns []string        `json:"columns"`
	Values  [][]interface{} `json:"values"`
}

ExportData the export data struct

type Flow

type Flow struct {
	Name        string                 `json:"-"`
	Source      string                 `json:"-"`
	Scripts     map[string]string      `json:"-"`
	Label       string                 `json:"label"`
	Version     string                 `json:"version"`
	Description string                 `json:"description,omitempty"`
	Nodes       []FlowNode             `json:"nodes,omitempty"`
	Output      interface{}            `json:"output,omitempty"`
	Global      map[string]interface{} // 全局变量
	Sid         string                 // 会话ID
}

Flow 工作流

func LoadFlow

func LoadFlow(source string, name string) *Flow

LoadFlow 加载数据流

func LoadFlowReturn

func LoadFlowReturn(source string, name string) (flow *Flow, err error)

LoadFlowReturn 加载数据流

func MakeFlow

func MakeFlow() *Flow

MakeFlow make a flow instance

func SelectFlow

func SelectFlow(name string) *Flow

SelectFlow 读取已加载Flow

func (*Flow) DSLCheck

func (flow *Flow) DSLCheck(source map[string]interface{}) error

DSLCheck check the FLow DSL

func (*Flow) DSLCompile

func (flow *Flow) DSLCompile(root string, file string, source map[string]interface{}) error

DSLCompile compile the FLow

func (*Flow) DSLRefresh

func (flow *Flow) DSLRefresh(root string, file string, source map[string]interface{}) error

DSLRefresh refresh the FLow

func (*Flow) DSLRemove

func (flow *Flow) DSLRemove(root string, file string) error

DSLRemove the DSL

func (*Flow) Exec

func (flow *Flow) Exec(args ...interface{}) interface{}

Exec 运行flow

func (*Flow) ExecNode

func (flow *Flow) ExecNode(node *FlowNode, ctx *FlowContext, prev int) []interface{}

ExecNode 运行节点

func (*Flow) FormatResult

func (flow *Flow) FormatResult(ctx *FlowContext) interface{}

FormatResult 结果集格式化输出

func (*Flow) LoadScript

func (flow *Flow) LoadScript(source string, name string) *Flow

LoadScript 载入脚本

func (*Flow) LoadScriptReturn

func (flow *Flow) LoadScriptReturn(source string, name string) (new *Flow, err error)

LoadScriptReturn 加载载入脚本

func (*Flow) Prepare

func (flow *Flow) Prepare()

Prepare 预加载 Query DSL

func (*Flow) Reload

func (flow *Flow) Reload() *Flow

Reload 重新载入API

func (*Flow) RunProcess

func (flow *Flow) RunProcess(node *FlowNode, ctx *FlowContext, data maps.Map) (interface{}, []interface{})

RunProcess 运行处理器

func (*Flow) RunQuery

func (flow *Flow) RunQuery(node *FlowNode, ctx *FlowContext, data maps.Map) (interface{}, []interface{})

RunQuery 运行 Query DSL 查询

func (*Flow) RunScript

func (flow *Flow) RunScript(node *FlowNode, ctx *FlowContext, data maps.Map, processResp interface{}, processOuts []interface{}) (interface{}, []interface{})

RunScript 运行数据处理脚本

func (*Flow) WithGlobal

func (flow *Flow) WithGlobal(global map[string]interface{}) *Flow

WithGlobal 设定全局变量

func (*Flow) WithSID

func (flow *Flow) WithSID(sid string) *Flow

WithSID 设定会话ID

type FlowContext

type FlowContext struct {
	In      []interface{}
	Res     map[string]interface{}
	Context *context.Context
	Cancel  context.CancelFunc
}

FlowContext 工作流上下文

func (*FlowContext) ExtendIn

func (ctx *FlowContext) ExtendIn(data maps.Map) maps.Map

ExtendIn 展开 in 参数

type FlowNode

type FlowNode struct {
	Name    string        `json:"name,omitempty"`
	Process string        `json:"process,omitempty"`
	Engine  string        `json:"engine,omitempty"` // 数据分析引擎名称
	Query   interface{}   `json:"query,omitempty"`  // 数据分析语言 Query Source
	DSL     share.DSL     `json:"-"`                // 数据分析语言 Query DSL
	Script  string        `json:"script,omitempty"`
	Args    []interface{} `json:"args,omitempty"`
	Outs    []interface{} `json:"outs,omitempty"`
}

FlowNode 工作流节点

type HTTP

type HTTP struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Description string `json:"description,omitempty"`
	Group       string `json:"group,omitempty"`
	Guard       string `json:"guard,omitempty"`
	Paths       []Path `json:"paths,omitempty"`
}

HTTP http 协议服务

func (HTTP) Route

func (http HTTP) Route(router gin.IRoutes, path Path, allows ...string)

Route 路径配置转换为路由

func (HTTP) Routes

func (http HTTP) Routes(router *gin.Engine, root string, allows ...string)

Routes 配置转换为路由

type IEncryptor

type IEncryptor interface {
	Set(crypt Encryptor)
	Encode(value string) (string, error)
	Decode(value string) (string, error)
	Validate(hash string, value string) bool
}

IEncryptor 加密器接口

func SelectCrypt

func SelectCrypt(name string) IEncryptor

SelectCrypt 选择加密器

type Import

type Import struct {
	Mapping map[string]string             `json:"mapping,omitempty"` // 源数据与数据模型字段映射表
	Process string                        `json:"process,omitempty"` // 源数据与数据模型转换处理器 (process & mapping 任选其一)
	Chunk   int                           `json:"chunk,omitempty"`   // 每次处理数据数量
	Notify  func(line int, record string) `json:"-"`                 // 进度通报函数
	Option  map[string]interface{}        `json:"option,omitempty"`  // CSV 分割符等参数

}

Import 数据导入配置

func NewImport

func NewImport(chunk int) *Import

NewImport 创建导入器

func (*Import) InsertCSV

func (impt *Import) InsertCSV(csvfile string, model string) *ResponseImport

InsertCSV 导入CSV使用 (insert)

func (*Import) NewResponse

func (impt *Import) NewResponse() *ResponseImport

NewResponse 创建导入器

func (*Import) Set

func (impt *Import) Set(key string, value interface{}) *Import

Set 配置源数据与数据模型字段映射表或处理器

func (*Import) Using

func (impt *Import) Using(process interface{}) *Import

Using 配置源数据与数据模型字段映射表或处理器

type Index

type Index struct {
	Comment string   `json:"comment,omitempty"`
	Name    string   `json:"name,omitempty"`
	Columns []string `json:"columns,omitempty"`
	Type    string   `json:"type,omitempty"` // primary,unique,index,match
}

Index the search index struct

func (Index) SetIndex

func (index Index) SetIndex(table schema.Blueprint)

SetIndex 设置索引

type MetaData

type MetaData struct {
	Name      string              `json:"name,omitempty"`      // 元数据名称
	Connector string              `json:"connector,omitempty"` // Bind a connector, MySQL, SQLite, Postgres, Clickhouse, Tidb, Oracle support. default is SQLite
	Table     Table               `json:"table,omitempty"`     // 数据表选项
	Columns   []Column            `json:"columns,omitempty"`   // 字段定义
	Indexes   []Index             `json:"indexes,omitempty"`   // 索引定义
	Relations map[string]Relation `json:"relations,omitempty"` // 映射关系定义
	Values    []maps.MapStrAny    `json:"values,omitempty"`    // 初始数值
	Option    Option              `json:"option,omitempty"`    // 元数据配置
}

MetaData 元数据

type Model

type Model struct {
	ID            string
	Name          string
	Source        string
	Driver        string // Driver
	MetaData      MetaData
	Columns       map[string]*Column // 字段映射表
	ColumnNames   []interface{}      // 字段名称清单
	PrimaryKey    string             // 主键(单一主键)
	PrimaryKeys   []string           // 主键(联合主键)
	UniqueColumns []*Column          // 唯一字段清单
}

Model 数据模型

func LoadModel

func LoadModel(source string, name string) *Model

LoadModel 载入数据模型

func LoadModelReturn

func LoadModelReturn(source string, name string) (model *Model, err error)

LoadModelReturn 加载数据模型

func MakeModel

func MakeModel() *Model

MakeModel make a model instance

func Select

func Select(name string) *Model

Select 读取已加载模型

func (*Model) Blueprint added in v0.10.2

func (mod *Model) Blueprint() (types.Blueprint, error)

Blueprint cast to the blueprint struct

func (*Model) Create

func (mod *Model) Create(row maps.MapStrAny) (int, error)

Create 创建单条数据, 返回新创建数据ID

func (*Model) CreateTable added in v0.10.2

func (mod *Model) CreateTable() error

CreateTable create the table of the model

func (*Model) DSLCheck

func (mod *Model) DSLCheck(source map[string]interface{}) error

DSLCheck check the DSL

func (*Model) DSLCompile

func (mod *Model) DSLCompile(root string, file string, source map[string]interface{}) error

DSLCompile compile the DSL

func (*Model) DSLRefresh

func (mod *Model) DSLRefresh(root string, file string, source map[string]interface{}) error

DSLRefresh refresh the DSL

func (*Model) DSLRemove

func (mod *Model) DSLRemove(root string, file string) error

DSLRemove the DSL

func (*Model) Delete

func (mod *Model) Delete(id interface{}) error

Delete 删除单条记录

func (*Model) DeleteWhere

func (mod *Model) DeleteWhere(param QueryParam) (int, error)

DeleteWhere 批量删除数据, 返回更新行数

func (*Model) Destroy

func (mod *Model) Destroy(id interface{}) error

Destroy 真删除单条记录

func (*Model) DestroyWhere

func (mod *Model) DestroyWhere(param QueryParam) (int, error)

DestroyWhere 批量真删除数据, 返回更新行数

func (*Model) DropTable added in v0.10.2

func (mod *Model) DropTable() error

DropTable drop the table of the model

func (*Model) EachSave

func (mod *Model) EachSave(rows []map[string]interface{}, eachrow ...maps.MapStrAny) ([]interface{}, error)

EachSave 批量保存数据, 返回数据ID集合

func (*Model) Export

func (mod *Model) Export(chunkSize int, process func(curr, total int)) ([]string, error)

Export the model

func (*Model) Filterselect

func (mod *Model) Filterselect(alias string, columns []interface{}, cmap map[string]ColumnMap, exportPrefix string) []interface{}

Filterselect 选择字段

func (*Model) Find

func (mod *Model) Find(id interface{}, param QueryParam) (maps.MapStr, error)

Find 查询单条记录

func (*Model) FliterIn

func (mod *Model) FliterIn(row maps.MapStrAny)

FliterIn 输入前过滤解码

func (*Model) FliterOut

func (mod *Model) FliterOut(row maps.MapStrAny)

FliterOut 输出前过滤解码

func (*Model) FliterWhere

func (mod *Model) FliterWhere(alias string, col interface{}) interface{}

FliterWhere 选项

func (*Model) Get

func (mod *Model) Get(param QueryParam) ([]maps.MapStr, error)

Get 按条件查询, 不分页

func (*Model) HasTable added in v0.10.2

func (mod *Model) HasTable() (bool, error)

HasTable check if the table of the model is exists

func (*Model) Import

func (mod *Model) Import(file string) error

Import the data

func (*Model) Insert

func (mod *Model) Insert(columns []string, rows [][]interface{}) error

Insert 插入多条数据

func (*Model) InsertValues added in v0.10.2

func (mod *Model) InsertValues() ([]int, []error)

InsertValues insert the default values of the model

func (*Model) Migrate

func (mod *Model) Migrate(force bool) error

Migrate 数据迁移

func (*Model) MustCreate

func (mod *Model) MustCreate(row maps.MapStrAny) int

MustCreate 创建单条数据, 返回新创建数据ID, 失败抛出异常

func (*Model) MustDelete

func (mod *Model) MustDelete(id interface{})

MustDelete 删除单条记录, 失败抛出异常

func (*Model) MustDeleteWhere

func (mod *Model) MustDeleteWhere(param QueryParam) int

MustDeleteWhere 批量删除数据, 返回更新行数, 失败抛出异常

func (*Model) MustDestroy

func (mod *Model) MustDestroy(id interface{})

MustDestroy 真删除单条记录, 失败抛出异常

func (*Model) MustDestroyWhere

func (mod *Model) MustDestroyWhere(param QueryParam) int

MustDestroyWhere 批量真删除数据, 返回更新行数, 失败抛出异常

func (*Model) MustEachSave

func (mod *Model) MustEachSave(rows []map[string]interface{}, eachrow ...maps.MapStrAny) []interface{}

MustEachSave 批量保存数据, 返回数据ID集合, 失败抛出异常

func (*Model) MustFind

func (mod *Model) MustFind(id interface{}, param QueryParam) maps.MapStr

MustFind 查询单条记录

func (*Model) MustGet

func (mod *Model) MustGet(param QueryParam) []maps.MapStr

MustGet 按条件查询, 不分页, 失败抛出异常

func (*Model) MustInsert

func (mod *Model) MustInsert(columns []string, rows [][]interface{})

MustInsert 插入多条数据, 失败抛出异常

func (*Model) MustPaginate

func (mod *Model) MustPaginate(param QueryParam, page int, pagesize int) maps.MapStr

MustPaginate 按条件查询, 分页, 失败抛出异常

func (*Model) MustSave

func (mod *Model) MustSave(row maps.MapStrAny) interface{}

MustSave 保存单条数据, 返回数据ID, 失败抛出异常

func (*Model) MustUpdate

func (mod *Model) MustUpdate(id interface{}, row maps.MapStrAny)

MustUpdate 更新单条数据, 失败抛出异常

func (*Model) MustUpdateWhere

func (mod *Model) MustUpdateWhere(param QueryParam, row maps.MapStrAny) int

MustUpdateWhere 按条件更新记录, 返回更新行数, 失败抛出异常

func (*Model) Paginate

func (mod *Model) Paginate(param QueryParam, page int, pagesize int) (maps.MapStr, error)

Paginate 按条件查询, 分页

func (*Model) Reload

func (mod *Model) Reload() *Model

Reload 更新模型

func (*Model) Save

func (mod *Model) Save(row maps.MapStrAny) (interface{}, error)

Save 保存单条数据, 不存在创建记录, 存在更新记录, 返回数据ID

func (*Model) SaveTable added in v0.10.2

func (mod *Model) SaveTable() error

SaveTable update or create the table of the model

func (*Model) Update

func (mod *Model) Update(id interface{}, row maps.MapStrAny) error

Update 更新单条数据

func (*Model) UpdateWhere

func (mod *Model) UpdateWhere(param QueryParam, row maps.MapStrAny) (int, error)

UpdateWhere 按条件更新记录, 返回更新行数

func (*Model) Validate

func (mod *Model) Validate(row maps.MapStrAny) []ValidateResponse

Validate 数值校验

type Option

type Option struct {
	Timestamps  bool `json:"timestamps,omitempty"`   // + created_at, updated_at 字段
	SoftDeletes bool `json:"soft_deletes,omitempty"` // + deleted_at 字段
	Trackings   bool `json:"trackings,omitempty"`    // + created_by, updated_by, deleted_by 字段
	Constraints bool `json:"constraints,omitempty"`  // + 约束定义
	Permission  bool `json:"permission,omitempty"`   // + __permission 字段
	Logging     bool `json:"logging,omitempty"`      // + __logging_id 字段
	Readonly    bool `json:"read_only,omitempty"`    // Ignore the migrate operation
}

Option 模型配置选项

type Out

type Out struct {
	Status   int               `json:"status"`
	Type     string            `json:"type,omitempty"`
	Body     interface{}       `json:"body,omitempty"`
	Headers  map[string]string `json:"headers,omitempty"`
	Redirect *Redirect         `json:"redirect,omitempty"`
}

Out http 输出

type Path

type Path struct {
	Label       string   `json:"label,omitempty"`
	Description string   `json:"description,omitempty"`
	Path        string   `json:"path"`
	Method      string   `json:"method"`
	Process     string   `json:"process"`
	Guard       string   `json:"guard,omitempty"`
	In          []string `json:"in,omitempty"`
	Out         Out      `json:"out,omitempty"`
}

Path HTTP Path

type Plugin

type Plugin struct {
	Client *plugin.Client
	Model  grpc.Model
	Name   string
	Cmd    string
}

Plugin 插件

func LoadPlugin

func LoadPlugin(cmd string, name string) *Plugin

LoadPlugin 加载插件

func LoadPluginReturn

func LoadPluginReturn(cmd string, name string) (plugin *Plugin, err error)

LoadPluginReturn 加载插件

func SelectPlugin

func SelectPlugin(name string) *Plugin

SelectPlugin 选择插件

type Process

type Process struct {
	Name    string
	Type    string
	Class   string
	Method  string
	Args    []interface{}
	Global  map[string]interface{} // 全局变量
	Sid     string                 // 会话ID
	Handler ProcessHandler
}

Process 运行器

func NewProcess

func NewProcess(name string, args ...interface{}) *Process

NewProcess 创建运行器

func ProcessOf

func ProcessOf(name string, args ...interface{}) (*Process, error)

ProcessOf 创建运行器, 创建成功返回处理器,创建失败返回错误信息

func (*Process) ArgsArray

func (process *Process) ArgsArray(index int) []interface{}

ArgsArray 读取 []interface{} 参数值

func (*Process) ArgsBool

func (process *Process) ArgsBool(i int, defaults ...bool) bool

ArgsBool 读取参数 String

func (*Process) ArgsInt

func (process *Process) ArgsInt(i int, defaults ...int) int

ArgsInt 读取参数 Int

func (*Process) ArgsMap

func (process *Process) ArgsMap(i int, defaults ...maps.MapStrAny) maps.MapStrAny

ArgsMap 读取Map 类型参数

func (*Process) ArgsNotNull

func (process *Process) ArgsNotNull(i int)

ArgsNotNull 查询参数不能为空

func (*Process) ArgsQueryParams

func (process *Process) ArgsQueryParams(i int, defaults ...QueryParam) QueryParam

ArgsQueryParams 读取参数 QueryParam

func (*Process) ArgsRecords

func (process *Process) ArgsRecords(index int) []map[string]interface{}

ArgsRecords 读取 []map[string]interface{} 参数值

func (*Process) ArgsString

func (process *Process) ArgsString(i int, defaults ...string) string

ArgsString 读取参数 String

func (*Process) ArgsStrings

func (process *Process) ArgsStrings(index int) []string

ArgsStrings 读取 []string 参数值

func (*Process) ArgsURLValue

func (process *Process) ArgsURLValue(i int, name string, defaults ...string) string

ArgsURLValue 读取参数

func (*Process) ArgsUint32 added in v0.10.2

func (process *Process) ArgsUint32(i int, defaults ...uint32) uint32

ArgsUint32 get Uint32

func (*Process) Exec

func (process *Process) Exec() (value interface{}, err error)

Exec 运行方法, 失败返回错误

func (*Process) Lang added in v0.10.2

func (process *Process) Lang(defaults ...string) string

Lang get lang

func (*Process) NumOfArgs

func (process *Process) NumOfArgs() int

NumOfArgs 参数数量

func (*Process) NumOfArgsIs

func (process *Process) NumOfArgsIs(num int) bool

NumOfArgsIs 参数数量是否等以给等值

func (*Process) Run

func (process *Process) Run() interface{}

Run 运行方法

func (*Process) ValidateArgNums

func (process *Process) ValidateArgNums(length int)

ValidateArgNums 校验参数数量( args )

func (*Process) WithGlobal

func (process *Process) WithGlobal(global map[string]interface{}) *Process

WithGlobal 设定全局变量

func (*Process) WithSID

func (process *Process) WithSID(sid string) *Process

WithSID 设定会话ID

type ProcessHandler

type ProcessHandler func(process *Process) interface{}

ProcessHandler 处理程序

type QueryOrder

type QueryOrder struct {
	Rel    string `json:"rel,omitempty"` // Relation Name
	Column string `json:"column"`
	Option string `json:"option,omitempty"` // desc, asc
}

QueryOrder Order 查询排序

type QueryParam

type QueryParam struct {
	Model    string          `json:"model,omitempty"`
	Table    string          `json:"table,omitempty"`
	Alias    string          `json:"alias,omitempty"`
	Export   string          `json:"export,omitempty"` // 导出前缀
	Select   []interface{}   `json:"select,omitempty"` // string | dbal.Raw
	Wheres   []QueryWhere    `json:"wheres,omitempty"`
	Orders   []QueryOrder    `json:"orders,omitempty"`
	Limit    int             `json:"limit,omitempty"`
	Page     int             `json:"page,omitempty"`
	PageSize int             `json:"pagesize,omitempty"`
	Withs    map[string]With `json:"withs,omitempty"`
}

QueryParam 数据查询器参数

func AnyToQueryParam

func AnyToQueryParam(v interface{}) (QueryParam, bool)

AnyToQueryParam interface 转换为 QueryParams

func URLToQueryParam

func URLToQueryParam(values url.Values) QueryParam

URLToQueryParam url.Values 转换为 QueryParams

func (QueryParam) NewQuery

func (param QueryParam) NewQuery() *QueryStack

NewQuery 新建查询栈

func (QueryParam) Order

func (param QueryParam) Order(order QueryOrder, qb query.Query, mod *Model)

Order 排序条件

func (QueryParam) Query

func (param QueryParam) Query(stack *QueryStack, stackParams ...QueryStackParam) *QueryStack

Query 构建查询栈(本版先实现,下一版本根据实际应用场景迭代)

func (QueryParam) Where

func (param QueryParam) Where(where QueryWhere, qb query.Query, mod *Model)

Where 查询条件

func (QueryParam) With

func (param QueryParam) With(name string, stack *QueryStack, with With, mod *Model)

With 关联查询

type QueryStack

type QueryStack struct {
	Builders []QueryStackBuilder
	Params   []QueryStackParam
	Current  int
}

QueryStack 查询栈

func MakeQueryStack

func MakeQueryStack() *QueryStack

MakeQueryStack 创建查询栈

func NewQueryStack

func NewQueryStack(param QueryParam) *QueryStack

NewQueryStack 新建查询栈

func (*QueryStack) Builder

func (stack *QueryStack) Builder() *QueryStackBuilder

Builder 返回当前查询构建器

func (*QueryStack) FirstQuery

func (stack *QueryStack) FirstQuery() query.Query

FirstQuery 返回第一个查询器

func (*QueryStack) Len

func (stack *QueryStack) Len() int

Len 查询器数量

func (*QueryStack) Merge

func (stack *QueryStack) Merge(new *QueryStack)

Merge 合并 Stack

func (*QueryStack) Next

func (stack *QueryStack) Next() int

Next 返回下一个查询器

func (*QueryStack) Paginate

func (stack *QueryStack) Paginate(page int, pagesize int) maps.MapStrAny

Paginate 执行查询栈(分页查询)

func (*QueryStack) Push

func (stack *QueryStack) Push(builder QueryStackBuilder, param QueryStackParam)

Push 添加查询器

func (*QueryStack) Query

func (stack *QueryStack) Query() query.Query

Query 返回当前查询器

func (*QueryStack) QueryParam

func (stack *QueryStack) QueryParam() QueryParam

QueryParam 返回当前查询参数

func (*QueryStack) Relation

func (stack *QueryStack) Relation() Relation

Relation 返回当前查询参数

func (*QueryStack) Run

func (stack *QueryStack) Run() []maps.MapStrAny

Run 执行查询栈

type QueryStackBuilder

type QueryStackBuilder struct {
	Model     *Model
	Query     query.Query
	ColumnMap map[string]ColumnMap
}

QueryStackBuilder 查询构建器

type QueryStackParam

type QueryStackParam struct {
	QueryParam   QueryParam
	Relation     Relation
	ExportPrefix string // 字段导出前缀
}

QueryStackParam QueryStack 查询参数

type QueryWhere

type QueryWhere struct {
	Rel    string       `json:"rel,omitempty"` // Relation Name
	Column interface{}  `json:"column,omitempty"`
	Value  interface{}  `json:"value,omitempty"`
	Method string       `json:"method,omitempty"` // where,orwhere, wherein, orwherein...
	OP     string       `json:"op,omitempty"`     // 操作 eq/gt/lt/ge/le/like...
	Wheres []QueryWhere `json:"wheres,omitempty"` // 分组查询
}

QueryWhere Where 查询条件

type Redirect added in v0.10.2

type Redirect struct {
	Code     int    `json:"code,omitempty"`
	Location string `json:"location,omitempty"`
}

Redirect out redirect

type Relation

type Relation struct {
	Name    string     `json:"-"`
	Type    string     `json:"type"`
	Key     string     `json:"key,omitempty"`
	Model   string     `json:"model,omitempty"`
	Foreign string     `json:"foreign,omitempty"`
	Links   []Relation `json:"links,omitempty"`
	Query   QueryParam `json:"query,omitempty"`
}

Relation the new xun model relation

type ResponseImport

type ResponseImport struct {
	Import  *Import       `json:"import"`  // 导入数据
	Errors  *ErrorsImport `json:"errors"`  // 导入错误集合
	Success int           `json:"success"` // 成功导入记录数量
	Failure int           `json:"failure"` // 失败导入记录数量
	Total   int           `json:"total"`   // 总记录记录数量
}

ResponseImport 导出结果

func (*ResponseImport) CastInsert

func (resp *ResponseImport) CastInsert(line int, data []map[string]string, model *Model) ([]string, [][]interface{})

CastInsert 数据格式转换

func (*ResponseImport) Error

func (resp *ResponseImport) Error(mesage string, code int, args ...interface{}) *ErrorOfImport

Error 导入数据时错误

func (*ResponseImport) InsertChunk

func (resp *ResponseImport) InsertChunk(line int, data []map[string]string, model *Model)

InsertChunk 导入数据 (insert)

func (*ResponseImport) IsError

func (resp *ResponseImport) IsError(line int, process interface{}) bool

IsError 错误检查

type Schedule

type Schedule struct {
	Name     string        `json:"name"`
	Process  string        `json:"process,omitempty"`
	Schedule string        `json:"schedule"`
	TaskName string        `json:"task,omitempty"`
	Args     []interface{} `json:"args,omitempty"`

	Enabled bool
	// contains filtered or unexported fields
}

Schedule the schedule struct

func LoadSchedule

func LoadSchedule(source string, name string) (*Schedule, error)

LoadSchedule load schedule

func SelectSchedule

func SelectSchedule(name string) *Schedule

SelectSchedule select schedule by name

func (*Schedule) Start

func (sch *Schedule) Start()

Start start the schedule

func (*Schedule) Stop

func (sch *Schedule) Stop()

Stop start the schedule

type Server

type Server struct {
	Debug  bool     `json:"debug,omitempty"`
	Port   int      `json:"port,omitempty"`
	Host   string   `json:"host,omitempty"`
	Root   string   `json:"root,omitempty"`   // API 根目录
	Allows []string `json:"allows,omitempty"` // 许可跨域访问域名
}

Server API 服务配置

type Socket

type Socket struct {
	Name         string      `json:"name"`
	Version      string      `json:"version"`
	Mode         string      `json:"mode,omitempty"` // Server | client
	Description  string      `json:"description,omitempty"`
	Protocol     string      `json:"protocol,omitempty"`
	Host         string      `json:"host,omitempty"`
	Port         string      `json:"port,omitempty"`
	Event        SocketEvent `json:"event,omitempty"`
	Timeout      int         `json:"timeout,omitempty"` // timeout (seconds)
	BufferSize   int         `json:"buffer,omitempty"`  // bufferSize
	KeepAlive    int         `json:"keep,omitempty"`    // -1 not keep alive, 0 keep alive always, keep alive n seconds.
	Process      string      `json:"process,omitempty"`
	AttemptAfter int         `json:"attempt_after,omitempty"` // Attempt attempt_after
	Attempts     int         `json:"attempts,omitempty"`      // max times try to reconnect server when connection break (client mode only)
	// contains filtered or unexported fields
}

Socket struct

func LoadSocket

func LoadSocket(source string, name string) (*Socket, error)

LoadSocket load socket server/client

func SelectSocket

func SelectSocket(name string) *Socket

SelectSocket Get socket by name

func (Socket) Connect

func (sock Socket) Connect(args ...interface{}) error

Connect Connect to server

func (Socket) Open

func (sock Socket) Open(args ...interface{}) error

Open Connect the socket server

func (Socket) Start

func (sock Socket) Start(args ...interface{})

Start Start server

type SocketEvent

type SocketEvent struct {
	Data      string `json:"data,omitempty"`
	Error     string `json:"error,omitempty"`
	Closed    string `json:"closed,omitempty"`
	Connected string `json:"connected,omitempty"`
}

SocketEvent struct

type Store

type Store struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description,omitempty"`
	Connector   string                 `json:"connector,omitempty"`
	Type        string                 `json:"type,omitempty"` // warning: type is deprecated in the future new version
	Option      map[string]interface{} `json:"option,omitempty"`
}

Store the kv-store setting

type Table

type Table struct {
	Name        string   `json:"name,omitempty"`   // optional, if not set, the default is generate from model name. eg name.space.user, table name is name_space_user
	Prefix      string   `json:"prefix,omitempty"` // optional, the table prefix
	Comment     string   `json:"comment,omitempty"`
	Engine      string   `json:"engine,omitempty"` // InnoDB,MyISAM ( MySQL Only )
	Collation   string   `json:"collation"`
	Charset     string   `json:"charset"`
	PrimaryKeys []string `json:"primarykeys"`
}

Table the model mapping table in DB

type TaskOption

type TaskOption struct {
	Name         string      `json:"name"`
	Process      string      `json:"process"`
	Size         interface{} `json:"size,omitempty"`
	WorkerNums   interface{} `json:"worker_nums,omitempty"`
	AttemptAfter interface{} `json:"attempt_after,omitempty"`
	Attempts     interface{} `json:"attempts,omitempty"`
	Timeout      interface{} `json:"timeout,omitempty"`
	Event        struct {
		Next     string `json:"next,omitempty"`
		Add      string `json:"add,omitempty"`
		Success  string `json:"success,omitempty"`
		Error    string `json:"error,omitempty"`
		Progress string `json:"progress,omitempty"`
	} `json:"event"`
}

TaskOption the task option

type Template

type Template struct{}

Template the Template DSL

func MakeTemplate

func MakeTemplate() *Template

MakeTemplate make a template instance

func (*Template) DSLCheck

func (tpl *Template) DSLCheck(source map[string]interface{}) error

DSLCheck check the DSL

func (*Template) DSLCompile

func (tpl *Template) DSLCompile(root string, file string, source map[string]interface{}) error

DSLCompile compile the DSL

func (*Template) DSLRefresh

func (tpl *Template) DSLRefresh(root string, file string, source map[string]interface{}) error

DSLRefresh refresh the DSL

func (*Template) DSLRemove

func (tpl *Template) DSLRemove(root string, file string) error

DSLRemove the DSL

type UploadFile added in v0.10.2

type UploadFile struct {
	Name     string               `json:"name"`
	TempFile string               `json:"tempFile"`
	Size     int64                `json:"size"`
	Header   textproto.MIMEHeader `json:"mimeType"`
}

UploadFile upload file

type ValidateResponse

type ValidateResponse struct {
	Line     int      `json:"line,omitempty"`
	Column   string   `json:"column,omitempty"`
	Messages []string `json:"messages,omitempty"`
}

ValidateResponse 数据校验返回结果

type Validation

type Validation struct {
	Method  string        `json:"method"`
	Args    []interface{} `json:"args,omitempty"`
	Message string        `json:"message,omitempty"`
}

Validation the field validation struct

type WebSocket

type WebSocket struct {
	websocket.WSClientOption
	Event  WebSocketEvent `json:"event,omitempty"`
	Client *websocket.WSClient
}

WebSocket the websocket struct

func LoadWebSocket

func LoadWebSocket(source string, name string) (*WebSocket, error)

LoadWebSocket load websockets client

func SelectWebSocket

func SelectWebSocket(name string) *WebSocket

SelectWebSocket Get WebSocket client by name

func (*WebSocket) Open

func (ws *WebSocket) Open(args ...string) error

Open open the websocket connection

type WebSocketEvent

type WebSocketEvent struct {
	Data      string `json:"data,omitempty"`
	Error     string `json:"error,omitempty"`
	Closed    string `json:"closed,omitempty"`
	Connected string `json:"connected,omitempty"`
}

WebSocketEvent the websocket struct

type With

type With struct {
	Name  string     `json:"name"`
	Query QueryParam `json:"query,omitempty"`
}

With relations 关联查询

Jump to

Keyboard shortcuts

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