app

package
v1.0.1006 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

*

  • App结构体 *
  • @create 2021-6-19
  • @author deatil

func New

func New() *App

App 结构体

func (*App) BootService

func (this *App) BootService(s iprovider.ServiceProvider)

引导服务

func (*App) CallBootedCallbacks

func (this *App) CallBootedCallbacks()

启动后回调

func (*App) CallBootingCallbacks

func (this *App) CallBootingCallbacks()

启动前回调

func (*App) GetLoadedProviders added in v1.0.1003

func (this *App) GetLoadedProviders() map[string]bool

GetLoadedProviders

func (*App) GetProviderName added in v1.0.1003

func (this *App) GetProviderName(provider any) (name string)

反射获取服务提供者名称

func (*App) GetRegister added in v1.0.1003

func (this *App) GetRegister(p any) iprovider.ServiceProvider

获取注册的服务提供者

func (*App) GetRootCmd

func (this *App) GetRootCmd() *command.Command

获取根脚本

func (*App) GetSchedule

func (this *App) GetSchedule() *schedule.Schedule

获取计划任务

func (*App) IsDev

func (this *App) IsDev() bool

是否为开发者模式

func (*App) IsRunned added in v1.0.1003

func (this *App) IsRunned() bool

是否为已运行

func (*App) ProviderIsLoaded added in v1.0.1003

func (this *App) ProviderIsLoaded(provider string) bool

ProviderIsLoaded

func (*App) Register

func (this *App) Register(f func() iprovider.ServiceProvider) iprovider.ServiceProvider

注册服务提供者

func (*App) Registers

func (this *App) Registers(providers []func() iprovider.ServiceProvider)

批量导入

func (*App) Run

func (this *App) Run()

运行

func (*App) RunningInConsole

func (this *App) RunningInConsole() bool

获取命令行状态

func (*App) WithBooted

func (this *App) WithBooted(f func())

设置启动后函数

func (*App) WithBooting

func (this *App) WithBooting(f func())

设置启动前函数

func (*App) WithConfig

func (this *App) WithConfig(conf *config.Config) *App

设置配置

func (*App) WithNetListener

func (this *App) WithNetListener(listener net.Listener) *App

设置自定义监听

func (*App) WithRootCmd

func (this *App) WithRootCmd(cmd *command.Command)

设置根脚本

func (*App) WithRunningInConsole

func (this *App) WithRunningInConsole(console bool)

设置命令行状态

func (*App) WithSchedule

func (this *App) WithSchedule(cron *schedule.Schedule)

设置计划任务

type ServiceProviderSchedule

type ServiceProviderSchedule interface {
	Schedule(*schedule.Schedule)
}

计划任务接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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