Documentation ¶
Index ¶
- Constants
- Variables
- func DBClose() error
- func DBConnect(dbconfig config.Database) (err error)
- func DirAbs(dir string) string
- func DirNotExists(dir string) bool
- func File(id string, ext string) string
- func GetAppFileBaseName(root string, file string) string
- func GetAppFileName(root string, file string) string
- func GetAppPluginFileName(root string, file string) string
- func GetDefaultColumns(name string) map[string]Column
- func GetDefaultFilters(name string) map[string]Filter
- func GetFileBaseName(root string, file string) string
- func GetFileName(root string, file string) string
- func GetQueryParam(v interface{}, sid string) types.QueryParam
- func GetTypeName(path string) (name string, typ string)
- func ID(root string, file string) string
- func ImportJSON(name string, in []interface{}, v interface{}) error
- func Load(cfg config.Config) error
- func LoadBuildIn(dir string) error
- func LoadFrom(dir string) error
- func ReadFile(filename string) []byte
- func ScriptName(filename string) string
- func SessionFile() error
- func SessionRedis() error
- func SessionStart() error
- func SessionStop()
- func SpecName(root string, file string) string
- func Walk(root string, typeName string, cb func(root, filename string)) error
- func Watch(root string, cb func(op string, file string))
- type API
- func (api API) DefaultInt(i int, defaults ...int) int
- func (api API) DefaultString(i int, defaults ...string) string
- func (api API) MergeDefaultQueryParam(param types.QueryParam, i int, sid string) types.QueryParam
- func (api API) ProcessIs(name string) bool
- func (api *API) UnmarshalJSON(data []byte) error
- func (api API) ValidateLoop(name string) API
- type APIImp
- type AppInfo
- type AppRoot
- type AppStorage
- type AppStorageOSS
- type Column
- type ColumnImp
- type Filter
- type FilterImp
- type Importable
- type Page
- type PageImp
- type Render
- type RenderImp
- type Script
- func GetAppFile(root string, filepath string) Script
- func GetAppFilesFS(root string, typ string) []Script
- func GetAppPluginFile(root string, file string) Script
- func GetAppPlugins(root string, typ string) []Script
- func GetFile(root string, path string) Script
- func GetFilesBin(root string, typ string) []Script
- func GetFilesFS(root string, typ string) []Script
- type Static
Constants ¶
const BUILDIN = false
BUILDIN 打包应用合成一个制品
const BUILDNAME = "yao"
BUILDNAME 制品名称
const PRVERSION = "DEV"
PRVERSION PreRelease Version
const VERSION = "0.10.3"
VERSION 版本号
Variables ¶
var Libs = map[string]map[string]interface{}{}
Libs 共享库
Functions ¶
func GetAppFileBaseName ¶
GetAppFileBaseName 读取文件base
func GetAppPluginFileName ¶
GetAppPluginFileName 读取文件
func GetDefaultColumns ¶
GetDefaultColumns 读取数据模型字段的呈现方式
func GetDefaultFilters ¶
GetDefaultFilters 读取数据模型索引字段的过滤器
func GetFileBaseName ¶
GetFileBaseName 读取文件base
func GetQueryParam ¶
func GetQueryParam(v interface{}, sid string) types.QueryParam
GetQueryParam 解析参数
func ID ¶ added in v0.10.2
ID parse unique name root: "/tests/apis" file: "/tests/apis/foo/bar.http.json"
Types ¶
type API ¶
type API struct { Name string `json:"-"` Source string `json:"-"` Disable bool `json:"disable,omitempty"` Process string `json:"process,omitempty"` Guard string `json:"guard,omitempty"` Default []interface{} `json:"default,omitempty"` Importable }
API API 配置数据结构
func (API) DefaultString ¶
DefaultString 读取参数 String
func (API) MergeDefaultQueryParam ¶
func (api API) MergeDefaultQueryParam(param types.QueryParam, i int, sid string) types.QueryParam
MergeDefaultQueryParam 合并默认查询参数
func (*API) UnmarshalJSON ¶
UnmarshalJSON API 字段JSON解析
type AppInfo ¶
type AppInfo struct { Name string `json:"name,omitempty"` L map[string]string `json:"-"` Short string `json:"short,omitempty"` Version string `json:"version,omitempty"` Description string `json:"description,omitempty"` Icons maps.MapStrSync `json:"icons,omitempty"` Storage AppStorage `json:"storage,omitempty"` Option map[string]interface{} `json:"option,omitempty"` XGen string `json:"xgen,omitempty"` AdminRoot string `json:"adminRoot,omitempty"` Static *Static `json:"public,omitempty"` Optional map[string]interface{} `json:"optional,omitempty"` }
AppInfo 应用信息
var App AppInfo
App 应用信息
type AppRoot ¶
type AppRoot struct { APIs string Flows string Models string Plugins string Tables string Charts string Screens string Data string }
AppRoot 应用目录
type AppStorage ¶
type AppStorage struct { Default string `json:"default"` Buckets map[string]string `json:"buckets,omitempty"` S3 map[string]interface{} `json:"s3,omitempty"` OSS *AppStorageOSS `json:"oss,omitempty"` COS map[string]interface{} `json:"cos,omitempty"` }
AppStorage 应用存储
type AppStorageOSS ¶
type AppStorageOSS struct { Endpoint string `json:"endpoint,omitempty"` ID string `json:"id,omitempty"` Secret string `json:"secret,omitempty"` RoleArn string `json:"roleArn,omitempty"` SessionName string `json:"sessionName,omitempty"` }
AppStorageOSS 阿里云存储
type Column ¶
type Column struct { Label string `json:"label"` Export string `json:"export,omitempty"` View Render `json:"view,omitempty"` Edit Render `json:"edit,omitempty"` Form Render `json:"form,omitempty"` Importable }
Column 字段呈现方式
func (*Column) UnmarshalJSON ¶
UnmarshalJSON Column 字段JSON解析
type Filter ¶
type Filter struct { Label string `json:"label"` Bind string `json:"bind,omitempty"` Input Render `json:"input,omitempty"` Importable }
Filter 查询过滤器
func (*Filter) UnmarshalJSON ¶
UnmarshalJSON Filter 字段JSON解析
type Importable ¶
type Importable struct { Import string `json:"@,omitempty"` // 从 Global 或 Vendor 载入 In []interface{} `json:"in,omitempty"` // 从 Global 或 Vendor 载入, 解析参数 }
Importable 可导入JSON
type Page ¶
type Page struct { Primary string `json:"primary"` Layout map[string]interface{} `json:"layout"` Actions map[string]Render `json:"actions,omitempty"` Option map[string]interface{} `json:"option,omitempty"` Importable }
Page 页面
func (*Page) UnmarshalJSON ¶
UnmarshalJSON Page 字段JSON解析
type Render ¶
type Render struct { Type string `json:"type,omitempty"` Props map[string]interface{} `json:"props,omitempty"` Components map[string]interface{} `json:"components,omitempty"` Importable }
Render 组件渲染方式
func (*Render) UnmarshalJSON ¶
UnmarshalJSON Render 字段JSON解析
type Script ¶
Script 脚本文件类型
func GetAppFilesFS ¶
GetAppFilesFS 遍历应用目录,读取文件列表
func GetAppPluginFile ¶
GetAppPluginFile 读取文件
func GetAppPlugins ¶
GetAppPlugins 遍历应用目录,读取文件列表