app

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package app 提供应用启动器

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Config    *Config
	DB        *gorm.DB
	Redis     *redislib.Client
	TxManager *tx.Manager
	HTTP      *httpx.Server
}

App 应用

func New

func New(cfg *Config) (*App, error)

New 创建应用

func (*App) Run

func (a *App) Run() error

Run 启动应用

func (*App) Shutdown

func (a *App) Shutdown(ctx context.Context) error

Shutdown 关闭应用

type Config

type Config struct {
	Service ServiceConfig
	HTTP    httpx.Config
	Log     log.Config
	DB      db.Config
	Redis   redis.Config
}

Config 应用配置

type ServiceConfig

type ServiceConfig struct {
	ID   int
	Name string
}

Jump to

Keyboard shortcuts

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