Skip to content
/ hyper Public

Hyper is an boilerplate for Golang Gin framework

License

Notifications You must be signed in to change notification settings

cyub/hyper

Repository files navigation

Hyper

Hyper is a lightweight and easy-to-use framework. The hyper framework works out of the box. It has built-in commonly used components, you only need to turn it on according to your needs.

Feature

  • Based on gin framework, Lightweight and easy to use
  • Config
    • Based on spf13/viper package
    • Support local files (yaml format) and consul
  • Logger
    • Base on sirupsen/logrus package
    • Support multiple output sources (stdout/stderr/file)
    • Support text or json format log output
  • Queue
    • Support redis and kafka two types of queue storage backend
    • Ability to recover from abnormal consumption tasks
    • Support consumer task failure retry function
    • Built-in prometheus exporter, you can review your queue
  • Mysql
    • Base on go-gorm/gorm package
    • The maximum number of connections, enable sql log and other settings only need to be configured
  • Discover
    • Support Consul-based service registration and discovery
  • Selector
    • Support getting nodes from Discover for load balancing
    • Support RoundRobin strategy
  • Cache
    • Support redis as a storage backend
  • Built-in performance analysis tool pprof

Install and Use

Install

go get -u github.com/cyub/hyper/cmd/[email protected]

Create Application

cd www/
hyper new your_project_name

Run Application

cd your_project_name
make run

If an error message like github.com/coreos/[email protected]+incompatible/client/keys.generated.go:63:14: z.HasExtensions appears during operation, remove this keys.generated.go file to solve the problem

Access Application

curl localhost:8000/welcome