Categorygithub.com/headwindfly/clevergo
modulepackage
1.1.1
Repository: https://github.com/headwindfly/clevergo.git
Documentation: pkg.go.dev

# README

CleverGo

Go Report Card GoDoc Build Status license GitHub release

CleverGo is a simple, high performance and secure web framework for Go (go programing language). It built on top of fasthttp.

Because it is a new project, so it have not do more tests, but this task has been added to TODO LIST.

Some common features and components can be found at https://github.com/clevergo.

Such as: websocket, sessions, captcha, csrf, jwt

  1. Installation
  2. Documentation
  3. Features
  4. Middlewares
  5. Examples
  6. Contribution
  7. Relevant Packages

Installation

go get github.com/headwindfly/clevergo

Documentation

The documentations is not complete now, but we provided completed examples.

Back to top

Features

  • High performance
  1. CleverGo uses fasthttp instead of net/http, so it is more fast than net/http‘s frameworks.
  2. CleverGo's handler router is a high performance router(fork from fasthttprouter).
  3. Simple architecture.
  4. No reflect.

Please refer to Go Web Framework Benchmark for getting more detail.

  • Lightweight

CleverGo's architecture is very simple, such as the Middleware and Handler.

  • Easy to use

We provides some examples below, see also Examples.

  • Multiple Domains

See also Application example

Back to top

Middlewares

NameDescriptionUsage
Session MiddlwareSession MiddlewareSession Middlware
CSRF MiddlewareCSRF attack protectionCSRF Middleware
JWT MiddlewareJSON WEB TOKEN MiddlewareJWT Middleware

Back to top

Examples

NameDescriptionUsage
Basic UsageBasic UsageBasic Usage
MiddlewareMiddlewareMiddleware
WebsocketWebsocketWebsocket
SessionSessionSession
RESTFUL APIRESTFUL APIRestful API
CSRF MiddlewareCSRF attack protectionCSRF Protection
CaptchaCaptchaCaptcha
JSON WEB TOKENJSON WEB TOKENJSON WBE TOKEN

More examples can be found at Examples.

Back to top

TODO LIST

  1. Perfect the documents and examples.
  2. Add tests.

Back to top

Contribution

  1. Fork this repository.
  2. Added your code on your repository.
  3. Send pull request.

I am willing to accept any pull requests and advises.

Back to top

Relevant Packages

Most of packages can be found at https://github.com/clevergo.

Back to top

Actual Applications

How to add my application?

Fork and added your application in README.md and then send pull request.

Back to top

# Packages

No description provided by the author
No description provided by the author

# Functions

ListenAndServe is a alias of fasthttp.ListenAndServe.
ListenAndServeTLS is a alias of fasthttp.ListenAndServeTLS.
ListenAndServeTLSEmbed is a alias of fasthttp.ListenAndServeTLSEmbed.
ListenAndServeUNIX is a alias of fasthttp.ListenAndServeUNIX.
NewApplication returns an application's instance.
NewConfig returns default configuration.
NewContext returns a Context instance.
NewRouter returns a Router's instance.

# Constants

Logo of CleverGo.
ServerTypeDefault means HTTP Application.
ServerTypeTLS means TLS Application.
ServerTypeTLSEmbed means TLSEmbed Application.
ServerTypeUNIX means UNIX Application.
Version of CleverGo.

# Structs

Application for managing routers.
Config for Application.
Context of request.
Controller is an empty struct.
Router for managing request handlers.

# Interfaces

ControllerInterface contains the methods which the Controller should implements.
A Handler responds to an HTTP request.
Middleware Interface.

# Type aliases

The HandlerFunc type is an adapter to allow the use of ordinary functions as HTTP handlers.