# z1cnf **Repository Path**: z1gotool/z1cnf ## Basic Information - **Project Name**: z1cnf - **Description**: for config - **Primary Language**: Go - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-10-03 - **Last Updated**: 2025-08-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # z1cnf #### 介绍 轻量配置库,开箱即用,使用 yaml 做为配置文件,可以设置配置模版。若设置了配置模版,若没有给配置文件,会根据配置模版生成配置文件。 #### 软件架构 ``` 1 自动读取config/config.yaml 2 若config/config.yaml不存在,会从用户配置的模版(z1cnf.SetCnf(z1cnfContent))生成config/config.yaml,并提醒修改重启 ``` #### 安装教程 1. go get gitee.com/z1gotool/z1cnf 2. xxxx 3. xxxx #### 使用说明 ``` 1 常用函数 z1cnf.GetString(`db.host`) z1cnf.GetInt(`db.port`) z1cnf.GetString(`db.dbs.2`) 2 添加配置模版 第一步 import ( ... _ "embed" ... } 第二步 //go:embed config.yaml var z1cnfContent []byte var z1cnfPlaceholder = z1cnf.SetCnf(z1cnfContent) ``` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)