utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearConfig

func ClearConfig() error

ClearConfig 清除配置文件

func GetConfigDir

func GetConfigDir() (string, error)

GetConfigDir 获取配置文件目录

func GetConfigFilePath

func GetConfigFilePath() (string, error)

GetConfigFilePath 获取配置文件路径

func SaveConfig

func SaveConfig(config *Config) error

SaveConfig 保存配置到文件

Types

type Config

type Config struct {
	Type     string `json:"type"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	User     string `json:"user"`
	Password string `json:"password"`
	DbName   string `json:"dbname"`
}

Config 存储数据库连接的配置信息

func DisplayConfig

func DisplayConfig() (*Config, error)

DisplayConfig 显示当前配置信息

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig 从文件加载配置

Jump to

Keyboard shortcuts

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