utils

package
v0.0.0-...-d4fd6b2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigInstance = Config{}

Functions

func CloseGormDB

func CloseGormDB() error

func EnsureDir

func EnsureDir(path string) error

确保目录存在,如果不存在则创建

func FileExists

func FileExists(path string) bool

检查文件是否存在

func GetDefaultConfig

func GetDefaultConfig() *models.AppConfig

func GetGormDB

func GetGormDB() (*gorm.DB, error)

func InitAppDirs

func InitAppDirs() error

初始化应用目录结构

Types

type Config

type Config struct {
	HomeDir      string
	AppSeriesDir string
	AppDir       string
	ConfigDir    string
	ConfigPath   string
	DbDir        string
	DbPath       string
	LogDir       string
	LogPath      string
}

func (*Config) GetAppDir

func (c *Config) GetAppDir() string

func (*Config) GetAppSeriesDir

func (c *Config) GetAppSeriesDir() string

func (*Config) GetConfigDir

func (c *Config) GetConfigDir() string

func (*Config) GetConfigPath

func (c *Config) GetConfigPath() string

func (*Config) GetDbDir

func (c *Config) GetDbDir() string

func (*Config) GetDbPath

func (c *Config) GetDbPath() string

func (*Config) GetHomeDir

func (c *Config) GetHomeDir() string

func (*Config) GetLogDir

func (c *Config) GetLogDir() string

func (*Config) GetLogPath

func (c *Config) GetLogPath() string

func (*Config) LoadConfig

func (c *Config) LoadConfig() *models.AppConfig

func (*Config) SaveConfig

func (c *Config) SaveConfig(config *models.AppConfig)

Jump to

Keyboard shortcuts

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