container

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {

	// 业务模块
	AuthnModule            *assembler.AuthnModule
	UserModule             *assembler.UserModule
	AuthzModule            *assembler.AuthzModule
	IDPModule              *assembler.IDPModule
	SuggestModule          *assembler.SuggestModule
	CacheGovernanceService *cachegovernance.ReadService
	// contains filtered or unexported fields
}

Container 容器 负责管理所有模块的依赖注入和生命周期

func NewContainer

func NewContainer(mysqlDB *gorm.DB, redisClient *redis.Client, eventBus messaging.EventBus, encryptionKey []byte) *Container

NewContainer 创建容器 redisClient: Redis 客户端(用于缓存、令牌等) eventBus: 消息总线(可选,用于事件驱动,传 nil 则不使用消息队列) encryptionKey: IDP 模块使用的加密密钥(32 字节 AES-256),传 nil 则使用默认密钥

func (*Container) GetMySQLDB

func (c *Container) GetMySQLDB() *gorm.DB

GetMySQLDB 获取MySQL数据库连接

func (*Container) HealthCheck

func (c *Container) HealthCheck(ctx context.Context) error

HealthCheck 健康检查

func (*Container) Initialize

func (c *Container) Initialize() error

Initialize 初始化容器

func (*Container) IsInitialized

func (c *Container) IsInitialized() bool

IsInitialized 检查容器是否已初始化

func (*Container) PrintStatus

func (c *Container) PrintStatus()

PrintStatus 打印容器状态

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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