setupservice

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAdminUser

func CreateAdminUser(username, password, email string) error

CreateAdminUser 创建管理员账号

func InitDatabase

func InitDatabase(config DatabaseConfig) error

InitDatabase 初始化数据库

func IsInitialized

func IsInitialized() bool

IsInitialized 检查是否已初始化

func SaveConfig

func SaveConfig(config SiteConfig) error

SaveConfig 保存配置

Types

type DatabaseConfig

type DatabaseConfig struct {
	Type     string `json:"type"`     // mysql 或 sqlite
	Host     string `json:"host"`     // mysql 专用
	Port     string `json:"port"`     // mysql 专用
	DBName   string `json:"dbName"`   // 数据库名/sqlite文件路径
	Username string `json:"username"` // mysql 专用
	Password string `json:"password"` // mysql 专用
}

type SiteConfig

type SiteConfig struct {
	SiteName string         `json:"siteName"`
	SiteDesc string         `json:"siteDesc"`
	Database DatabaseConfig `json:"database"`
}

Jump to

Keyboard shortcuts

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