app

package
v0.0.0-...-289f9df Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeforeWait

func BeforeWait(funcs ...any)

BeforeWait 等待钩子

func Boot

func Boot() (err error)

func RegisterMigrates

func RegisterMigrates(ms ...any)

func RegisterSeeds

func RegisterSeeds(ss ...any)

func Start

func Start(wg *sync.WaitGroup) (n int)

func StartAndWait

func StartAndWait() (err error)

func Stop

func Stop()

func Use

func Use(modules ...Module)

Types

type Bootable

type Bootable interface {
	Boot() error
}

Bootable 表示模块需要被启动

type HasName

type HasName interface {
	Name() string
}

type HasSubModule

type HasSubModule interface {
	Register(subs ...Module) error
}

HasSubModule 接口表示模块可以包含子模块

type Initable

type Initable interface {
	Init() error
}

Initable 表示模块需要被初始化

type IsModule

type IsModule struct{}

type Module

type Module interface {
	// contains filtered or unexported methods
}

Module 表示实现了这个接口的结构体是一个框架模块。

type Service

type Service interface {
	//Start 启动服务并阻塞, 框架一般会将这个方法作为协程调用, 报错应打日志记录
	Start()
	//Stop 停止服务并阻塞, 报错应打日志记录
	Stop()
}

Jump to

Keyboard shortcuts

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