foundation

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make[T any](app *Application) (T, error)

Make 从容器解析服务(泛型版本)

func MustMake

func MustMake[T any](app *Application) T

MustMake 从容器解析服务,失败则 panic

Types

type Application

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

Application 应用核心

func New

func New(basePath string) *Application

New 创建新的应用实例

func (*Application) BasePath

func (app *Application) BasePath() string

BasePath 获取基础路径

func (*Application) Boot

func (app *Application) Boot() error

Boot 启动应用

func (*Application) Config

func (app *Application) Config() *config.Repository

Config 获取配置

func (*Application) Console

func (app *Application) Console() *console.Kernel

Console 获取控制台内核

func (*Application) Container

func (app *Application) Container() *container.Container

Container 获取容器

func (*Application) Register

func (app *Application) Register(provider ServiceProvider) *Application

Register 注册服务提供者

func (*Application) Router

func (app *Application) Router() *router.Router

Router 获取路由器

func (*Application) Run

func (app *Application) Run(addr ...string) error

Run 运行 Web 服务器

func (*Application) RunConsole

func (app *Application) RunConsole() error

RunConsole 运行控制台命令

type BaseServiceProvider

type BaseServiceProvider struct{}

BaseServiceProvider 基础服务提供者

func (*BaseServiceProvider) Boot

func (p *BaseServiceProvider) Boot(app *Application) error

func (*BaseServiceProvider) Register

func (p *BaseServiceProvider) Register(app *Application)

type ServiceProvider

type ServiceProvider interface {
	Register(app *Application)
	Boot(app *Application) error
}

ServiceProvider 服务提供者接口

Jump to

Keyboard shortcuts

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