app

package
v0.0.3-beta Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// List Applications
	List = make(map[string]*Config)

	// Indexes Application Index
	Indexes []string
)

Functions

func Command

func Command() []*cli.Command

func Init

func Init(t *Dux)

func IsRelease

func IsRelease() bool

IsRelease 判断是否编译 IsRelease determine whether to build

func Register

func Register(opt *Config)

Register Call this method to register the application with the framework

func Start

func Start(t *Dux)

Types

type Config

type Config struct {
	Name     string
	Config   any
	Init     func(t *Dux)
	Register func(t *Dux)
	Boot     func(t *Dux)
}

type Dux

type Dux struct {
	Lang string
	// contains filtered or unexported fields
}

Dux 基础结构 Dux infrastructure

func (*Dux) RegisterApp

func (t *Dux) RegisterApp(calls ...func())

RegisterApp 应用注册 RegisterApp register application

func (*Dux) RegisterCmd

func (t *Dux) RegisterCmd(calls ...func() []*cli.Command)

RegisterCmd 命令注册 RegisterCmd register command

func (*Dux) RegisterDir

func (t *Dux) RegisterDir(dirs ...string)

RegisterDir 自动创建目录 RegisterDir register folder creation

func (*Dux) RegisterLangFS

func (t *Dux) RegisterLangFS(fs embed.FS)

RegisterLangFS 注册语言包 RegisterLangFS register language packs

func (*Dux) RegisterTpl

func (t *Dux) RegisterTpl(name string, dir string)

RegisterTpl 注册模板目录 RegisterTpl register template folder

func (*Dux) RegisterTplFS

func (t *Dux) RegisterTplFS(name string, fs embed.FS)

RegisterTplFS 注册虚拟模板目录 RegisterTplFS register FS template folder

func (*Dux) Run

func (t *Dux) Run()

Run 运行命令 Run command

func (*Dux) SetAnnotations

func (t *Dux) SetAnnotations(data []*annotation.File)

SetAnnotations 设置索引文件 SetAnnotations set index file

func (*Dux) SetConfigDir

func (t *Dux) SetConfigDir(dir string)

SetConfigDir 设置配置目录 SetConfigDir setting the config folder

func (*Dux) SetDataDir

func (t *Dux) SetDataDir(dir string)

SetDataDir 设置数据目录 SetConfigDir setting the data folder

func (*Dux) SetPageFs

func (t *Dux) SetPageFs(fs embed.FS)

SetPageFs 设置页面目录 SetPageFs setting page folder

func (*Dux) SetStaticFs

func (t *Dux) SetStaticFs(fs embed.FS)

SetStaticFs 设置静态目录 SetStaticFs setting up static folder

func (*Dux) SetTablePrefix

func (t *Dux) SetTablePrefix(prefix string)

SetTablePrefix 设置表前缀 SetTablePrefix Set table prefix

func (*Dux) SetTimezone

func (t *Dux) SetTimezone(location *time.Location)

SetTimezone 设置时区 SetStaticFs setting the time zone

Jump to

Keyboard shortcuts

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