GithubHelp home page GithubHelp logo

pangum / pangu Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 7.0 829 KB

盘古,意为开天辟地(即所有的系统功能都是由盘古生长而来),Golang应用程序快速开发框架,受SpringBoot的启发而创建,尽量让使用者关注业务而不是底层框架;同时,尽量添加一些华丽而且实用的功能来方便开发者的使用。支持的功能有:1、类Springboot高生产力开发框架;2、配置文件支持(JSON、YAML、TOML、XML以及环境变量支持和默认值配置支持);3、丰富的插件支持(Web、Http Client、MQTT、Redis、gRPC等一系统生产力集合框架);4、线程安全;5、高度可配置;以及其它一系统旨在提高生产力的功能集合

Home Page: https://pangu.pangum.tech

License: Apache License 2.0

Go 100.00%
golang go framework golang-library grpc pangu library gex exec plugin autoconfig autoconfiguration

pangu's Introduction

盘古 Golang应用程序框架

编译状态 Golang质量 版本 仓库大小 最后提交 授权协议 语言个数 最佳语言 星星个数

一个Golang应用程序快速开发框架,有以下特性

  • 快速开发
  • 内置配置文件加载
    • Yaml
    • Toml
    • Json
    • XML
    • 很方便定制自己的配置文件加载器
  • 内置强大的数据验证
    • 内置强大的且非常多的数据验证器
    • 很方便的定制自己的数据验证器
  • 强大的扩展功能
  • 强大的配置功能
    • 徽标
    • 帮助信息
    • 命令行
    • 一切可配置点皆可配置
  • 线程安全
  • 内置依赖注入
  • 语义化
    • 方便使用
    • 多态行为,同一个调用在不同的场景下有不同的意义

快速开始

Pangu使用非常简单,只需要定义两部分代码启动方法启动器以及依赖关系,对于依赖关系

  • 可以没有依赖,如果没有,就不需要处理依赖
  • 一般稍微大型一点的系统都会有复杂的依赖关系,而这正是盘古框架的强项
  • 对于没有依赖或者依赖非常少的项目,使用盘古反而会使代码变多,这个需要大家酌情考虑

启动方法代码如下

package main

import (
    `github.com/pangum/pangu`
    `github.com/pangum/pangum`
)

func main() {
    panic(pangu.New(
        pangu.Named(`ziyunix`),
        pangu.Banner(`Ziyunix Server`, pangu.BannerTypeAscii),
    ).Run(newBootstrap))
}

启动器的代码如下

package main

type bootstrap struct {
    application *pangu.Application
}

func newBootstrap(application *pangu.Application) pangu.Bootstrap {
    return &bootstrap{
        application: application,
    }
}

依赖关系建议像如下处理

package rest

import (
	`github.com/pangum/pangu`
)

type Server struct {}

func newServer(/* 如果有依赖,可以在这里增加依赖:api *Api */) *Server {
	return new(Server)
}

func init() {
	pangu.New().Dependencies(
		newServer,
		// 其它依赖
		// ...
	)
}

Pangu有非常多的配置项,请参看使用文档

文档

点击这里查看最新文档

使用示例

点击这里查看最新的代码示例

项目实践

交流

微信群

捐助

支持宝 微信

感谢Jetbrains

本项目通过Jetbrains开源许可IDE编写源代码,特此感谢 Jetbrains图标

pangu's People

Contributors

dependabot[bot] avatar mergify[bot] avatar storezhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pangu's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.