{"id":28350693,"url":"https://github.com/harluo/boot","last_synced_at":"2025-07-01T05:05:28.794Z","repository":{"id":39316773,"uuid":"361666708","full_name":"harluo/boot","owner":"harluo","description":"一个受SpringBoot的启发而创建Golang应用程序快速开发框架，基于harluo/di运行时依赖注入框架而生，尽量让使用者关注业务而不是底层框架；同时，尽量添加一些华丽而且实用的功能来方便开发者的使用。支持的功能有：1、类Springboot高生产力开发框架；2、配置文件无缝切换（支持JSON、YAML、TOML、XML以及环境变量支持和默认值配置支持）；3、丰富的插件支持（Web、Http Client、MQTT、Redis、gRPC等一系统生产力集合框架）；4、线程安全；5、高度可配置；以及其它一系统旨在提高生产力的功能集合","archived":false,"fork":false,"pushed_at":"2025-05-28T21:53:38.000Z","size":1025,"stargazers_count":17,"open_issues_count":2,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T04:13:31.834Z","etag":null,"topics":["autoconfig","autoconfiguration","exec","framework","gex","go","golang","golang-library","grpc","library","pangu","plugin"],"latest_commit_sha":null,"homepage":"https://pangu.pangum.tech","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harluo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-26T08:02:41.000Z","updated_at":"2025-05-19T03:40:04.000Z","dependencies_parsed_at":"2023-10-20T09:26:29.044Z","dependency_job_id":"cf281a19-7b98-4521-8f3b-0d9454b59576","html_url":"https://github.com/harluo/boot","commit_stats":null,"previous_names":["storezhang/pangu","harluo/boot","pangum/pangu"],"tags_count":98,"template":false,"template_full_name":null,"purl":"pkg:github/harluo/boot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harluo%2Fboot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harluo%2Fboot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harluo%2Fboot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harluo%2Fboot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harluo","download_url":"https://codeload.github.com/harluo/boot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harluo%2Fboot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261029771,"owners_count":23099813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autoconfig","autoconfiguration","exec","framework","gex","go","golang","golang-library","grpc","library","pangu","plugin"],"created_at":"2025-05-27T21:32:57.312Z","updated_at":"2025-07-01T05:05:28.778Z","avatar_url":"https://github.com/harluo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `盘古` Golang应用程序框架\n[![编译状态](https://github.ruijc.com:20443/api/badges/pangum/pangu/status.svg)](https://github.ruijc.com:20443/pangum/pangu)\n[![Golang质量](https://goreportcard.com/badge/github.com/pangum/pangu)](https://goreportcard.com/report/github.com/pangum/pangu)\n![版本](https://img.shields.io/github/go-mod/go-version/pangum/pangu)\n![仓库大小](https://img.shields.io/github/repo-size/pangum/pangu)\n![最后提交](https://img.shields.io/github/last-commit/pangum/pangu)\n![授权协议](https://img.shields.io/github/license/pangum/pangu)\n![语言个数](https://img.shields.io/github/languages/count/pangum/pangu)\n![最佳语言](https://img.shields.io/github/languages/top/pangum/pangu)\n![星星个数](https://img.shields.io/github/stars/pangum/pangu?style=social)\n\n一个Golang应用程序快速开发框架，有以下特性\n\n- 快速开发\n- 内置配置文件加载\n  - `Json`/`Jsonc`/`Json5`\n  - `XML`\n  - 其它\n    - `YAML`，通过引入`github.com/pangum/yaml`支持\n    - `TOML`，通过引入`github.com/pangum/toml`支持\n    - 携程`Apollo`，通过引入`github.com/pangum/apollo`支持\n    - 阿里`Nacos`，通过引入`github.com/pangum/nacos`支持\n  - 很方便定制自己的配置文件加载器\n  - 零配置，可完全通过`环境变量`完成配置\n  - 支持配置文件覆盖\n  - 支持按`模块`划分配置文件，比如可以按如下模式划分配置文件\n    - `application.json/jsonc/xml/toml/yaml/yml`，提供应用程序本身需要的相关配置\n    - `logging.json/jsonc/xml/toml/yaml/yml`，提供日志相关配置\n    - `database.json/jsonc/xml/toml/yaml/yml`，提供数据库相关配置\n    - `grpc.json/jsonc/xml/toml/yaml/yml`，提供`gRPC`相关配置\n    - `...`其它配置文件\n    - 所有配置文件格式可以混用，比如配置可以是`json`、`jsonc`、`json5`、`yaml`、`yml`、`toml`等任意格式，只要正确的引入了相应的`加载器`\n  - 支持个性化配置文件编写，对于任何一个配置字段，可以有如下形式（比如配置项是`logggingLevel`）\n    - `原始配置项`即`loggingLevel`\n    - `下划线形式`即`logging_level`\n    - `中划线形式`即`logging-level`\n- 内置强大的数据验证\n  - 内置强大的且非常多的数据验证器\n  - 很方便的定制自己的数据验证器\n- 强大的扩展功能\n- 强大的配置功能\n  - 徽标\n  - 帮助信息\n  - 命令行\n  - 一切可配置点皆可配置\n- 线程安全\n- 内置依赖注入\n- 语义化\n  - 方便使用\n  - 多态行为，同一个调用在不同的场景下有不同的意义\n\n## 快速开始\n\n`Pangu`使用非常简单，只需要定义两部分代码`启动方法`和`启动器`以及`依赖关系`，对于`依赖关系`\n\n- 可以没有依赖，如果没有，就不需要处理依赖\n- 一般稍微大型一点的系统都会有复杂的依赖关系，而这正是`盘古`框架的强项\n- 对于没有依赖或者依赖非常少的项目，使用`盘古`反而会使代码变多，这个需要大家酌情考虑\n\n`启动方法`代码如下\n\n```go\npackage main\n\nimport (\n    `github.com/pangum/pangu`\n    `github.com/pangum/pangum`\n)\n\nfunc main() {\n    panic(pangu.New(\n        pangu.Named(`ziyunix`),\n        pangu.Banner(`Ziyunix Server`, pangu.BannerTypeAscii),\n    ).Run(newBootstrap))\n}\n```\n\n`启动器`的代码如下\n\n```go\npackage main\n\ntype bootstrap struct {\n    application *pangu.Application\n}\n\nfunc newBootstrap(application *pangu.Application) pangu.Bootstrap {\n    return \u0026bootstrap{\n        application: application,\n    }\n}\n```\n\n`依赖关系`建议像如下处理\n\n```go\npackage rest\n\nimport (\n\t`github.com/pangum/pangu`\n)\n\ntype Server struct {}\n\nfunc newServer(/* 如果有依赖，可以在这里增加依赖：api *Api */) *Server {\n\treturn new(Server)\n}\n\nfunc init() {\n\tpangu.New().Dependencies(\n\t\tnewServer,\n\t\t// 其它依赖\n\t\t// ...\n\t)\n}\n```\n\n\u003e `Pangu`有非常多的配置项，请参看[**使用文档**](https://pangu.pangum.tech)\n\n## 文档\n\n[点击这里查看最新文档](https://pangu.pangum.tech)\n\n## 使用示例\n\n[点击这里查看最新的代码示例](example)\n\n## 项目实践\n\n- [基础项目实战代码](https://github.com/pangum/example)\n  - 数据库操作\n  - 数据库迁移\n  - RESTFul接口\n  - 配置加载\n  - MQTT操作\n\n## 交流\n\n![微信群](doc/.vuepress/public/communication/wxwork.jpg)\n\n## 捐助\n\n![支持宝](https://github.com/storezhang/donate/raw/master/alipay-small.jpg)\n![微信](https://github.com/storezhang/donate/raw/master/weipay-small.jpg)\n\n## 感谢Jetbrains\n\n本项目通过`Jetbrains开源许可IDE`编写源代码，特此感谢\n[![Jetbrains图标](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/?from=pangum/pangu)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharluo%2Fboot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharluo%2Fboot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharluo%2Fboot/lists"}