DEV Community

Keepchen
Keepchen

Posted on

Introduce my works - Go-Sail

Whats the go-sail?

Go-Sail is a lightweight progressive web framework implemented using Go language. It is not the product of reinventing the wheel, but stands on the shoulders of giants and integrates existing excellent components to help users build stable and reliable services in the simplest way.
As its name suggests, you can regard it as the beginning of your own journey in the golang ecosystem. Go-Sail will help you start lightly and set sail.

How to use

go version >= 1.20

Install

go get -u github.com/keepchen/go-sail/v3

import (
    "net/http"
    "github.com/gin-gonic/gin"
    "github.com/keepchen/go-sail/v3/sail"
    "github.com/keepchen/go-sail/v3/sail/config"
)

var (
    conf = &config.Config{}
    registerRoutes = func(ginEngine *gin.Engine) {
        ginEngine.GET("/hello", func(c *gin.Context){
            c.String(http.StatusOK, "%s", "hello, world!")
        })
    }
)

func main() {
    sail.WakeupHttp("go-sail", conf).Hook(registerRoutes, nil, nil).Launch()
}
Enter fullscreen mode Exit fullscreen mode

Console screenshot after launched like this:

Go-Sail launch screenshot

Documentation

https://go-sail.dev

Features

  • [x] HTTP Responder
    • Uniform Response Fields
    • Managing HTTP status codes
    • Management business code
  • [x] Components
    • Database
    • Email
    • Jwt
    • Kafka
    • Logger
    • Nacos
    • Etcd
    • Nats
    • Redis
  • [x] Service Registration and Discovery
    • Nacos
    • Etcd
  • [x] Toolkit
    • Encryption and Decryption
    • File
    • IP
    • String
    • Random number
    • Date and Time
    • ...
  • [x] Log collection and export
    • Local files
    • Exporter
      • Redis
      • Kafka
      • Nats
  • [x] Scheduled Tasks
    • Cancellable
    • Disposable
    • Periodic
    • Linux Crontab style
    • Race Detection
  • [x] Telemetry and Observability
    • Call chain tracing
    • Prometheus
    • Pprof
    • Log Exporter
  • Performance monitor
    • Prometheus
    • Pprof
  • [x] API error codes
    • Dynamic injection
    • Internationalization
  • [x] Distributed lock based on Redis
    • Blocking
    • None-Blocking
  • [x] API Documentation
    • Redocly
    • Swagger

Big Thanks

Thank you to everyone who provided valuable suggestions and comments during the experience and use, as well as provided other kinds of help!

Other

  • PR is welcome: pull request
  • Issue is welcome: issue
  • Thank you for your star if you like this project :)

Use cases

stardots.io Pikaster FantaGoal
WinGoal Piggy (telegram mini-game) 生活好评助手-小程序

Star History

Star History

Repository

https://github.com/keepchen/go-sail

Top comments (1)

Collapse
 
john_wilson profile image
John Wilson

Good job my friend