Help us shape the future of Go! Take the 2026 Go Developer Survey

setup

package
v0.32.30 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OnInitialized func()

OnInitialized 首启成功后的回调(由装配层注入)。

用途:首启面关闭时做**收尾**动作——当前唯一消费方是 bootstrap 清理 一次性首启令牌(进程内 + 数据目录下的 .setup_token 文件)。

为何用钩子而不是直接 import bootstrap:app/setup 是领域服务,反向依赖 装配层会成环(bootstrap 已 import app/setup)。

Functions

This section is empty.

Types

type InitializeSystemReq

type InitializeSystemReq struct {
	AdminUsername string
	AdminPassword string
	AdminEmail    string
}

InitializeSystemReq 系统初始化请求

type Service

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

func NewService

func NewService(gormDB *gorm.DB) *Service

func (*Service) InitializeSystem

func (s *Service) InitializeSystem(ctx context.Context, req *InitializeSystemReq) error

InitializeSystem 初始化系统,创建第一个管理员

func (*Service) IsSystemInitialized

func (s *Service) IsSystemInitialized(ctx context.Context) (bool, error)

IsSystemInitialized 检查系统是否已初始化 通过检查是否存在管理员用户来判断

Jump to

Keyboard shortcuts

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