provider

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: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendProvider

func AppendProvider(f func() providerInterface.ServiceProvider)

添加服务提供者

func GetAllProvider

func GetAllProvider() []func() providerInterface.ServiceProvider

获取全部添加的服务提供者

Types

type Register

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

*

  • 注册器 *
  • @create 2021-9-8
  • @author deatil

func NewRegister

func NewRegister() *Register

*

  • 单例模式

func (*Register) Append

func (this *Register) Append(f func() providerInterface.ServiceProvider)

注册

func (*Register) GetAll

func (this *Register) GetAll() []func() providerInterface.ServiceProvider

*

  • 获取全部

type ServiceProvider

type ServiceProvider struct {
	// 启动 app
	App iapp.App

	// 路由
	Route *router.Engine

	// 启动前
	BootingCallback func()

	// 启动后
	BootedCallback func()
}

*

  • 服务提供者 *
  • @create 2021-7-11
  • @author deatil

func (*ServiceProvider) AddCommand

func (this *ServiceProvider) AddCommand(cmd *command.Command)

添加脚本

func (*ServiceProvider) AddCommands

func (this *ServiceProvider) AddCommands(cmds []any)

添加脚本

func (*ServiceProvider) AddGroup

func (this *ServiceProvider) AddGroup(conf map[string]string, fn func(*router.RouterGroup))

添加路由分组

func (*ServiceProvider) AddRoute

func (this *ServiceProvider) AddRoute(fn func(*router.Engine))

添加路由

func (*ServiceProvider) AddViewFunc

func (this *ServiceProvider) AddViewFunc(name string, fn any)

添加视图用方法

func (*ServiceProvider) Boot

func (this *ServiceProvider) Boot()

引导

func (*ServiceProvider) CallBootedCallback

func (this *ServiceProvider) CallBootedCallback()

启动后回调

func (*ServiceProvider) CallBootingCallback

func (this *ServiceProvider) CallBootingCallback()

启动前回调

func (*ServiceProvider) GetApp

func (this *ServiceProvider) GetApp() iapp.App

获取

func (*ServiceProvider) GetRoute

func (this *ServiceProvider) GetRoute() *router.Engine

获取

func (*ServiceProvider) LoadViewsFrom

func (this *ServiceProvider) LoadViewsFrom(path string, namespace string)

注册视图

func (*ServiceProvider) MergeConfigFrom

func (this *ServiceProvider) MergeConfigFrom(path string, key string)

配置信息

func (*ServiceProvider) Publishes

func (this *ServiceProvider) Publishes(obj any, paths map[string]string, group string)

推送

func (*ServiceProvider) Register

func (this *ServiceProvider) Register()

注册

func (*ServiceProvider) WithApp

func (this *ServiceProvider) WithApp(app any)

设置

func (*ServiceProvider) WithBooted

func (this *ServiceProvider) WithBooted(f func())

设置启动后函数

func (*ServiceProvider) WithBooting

func (this *ServiceProvider) WithBooting(f func())

设置启动前函数

func (*ServiceProvider) WithRoute

func (this *ServiceProvider) WithRoute(route *router.Engine)

设置

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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