kernel

package
v1.0.1002 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddProvider

func AddProvider(f func() any)

添加服务提供者

Types

type IServiceProvider

type IServiceProvider = interfaces.ServiceProvider

服务提供者接口

type Kernel

type Kernel struct {

	// 自定义运行监听
	NetListener net.Listener
	// contains filtered or unexported fields
}

*

  • 核心 *
  • @create 2021-10-10
  • @author deatil

func New

func New() *Kernel

实例化

func (*Kernel) LoadDefaultServiceProvider

func (this *Kernel) LoadDefaultServiceProvider() *Kernel

默认服务提供者

func (*Kernel) LoadServiceProvider

func (this *Kernel) LoadServiceProvider()

导入服务提供者

func (*Kernel) RunApp

func (this *Kernel) RunApp(console bool)

运行

func (*Kernel) RunCmd

func (this *Kernel) RunCmd()

加载脚本

func (*Kernel) RunServer

func (this *Kernel) RunServer()

运行服务

func (*Kernel) Terminate

func (this *Kernel) Terminate()

执行

func (*Kernel) WithNetListener

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

设置自定义监听

func (*Kernel) WithServiceProvider

func (this *Kernel) WithServiceProvider(f func() interfaces.ServiceProvider) *Kernel

添加服务提供者

func (*Kernel) WithServiceProviders

func (this *Kernel) WithServiceProviders(funcs []func() interfaces.ServiceProvider) *Kernel

批量添加服务提供者

type Provider

type Provider = func() IServiceProvider

服务提供者函数

func GetAllProvider

func GetAllProvider() []Provider

获取全部服务提供者

type Register

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

*

  • 注册器 *
  • @create 2021-12-19
  • @author deatil

func NewRegister

func NewRegister() *Register

*

  • 单例模式

func (*Register) GetRegisteredProviders

func (this *Register) GetRegisteredProviders() []Provider

*

  • 获取注册的全部服务提供者

func (*Register) WithProvider

func (this *Register) WithProvider(f func() any) *Register

注册

Jump to

Keyboard shortcuts

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