pigeon

package module
v0.0.0-...-aa3a249 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 9 Imported by: 7

README

Pigeon

An easy-to-use, flexible HTTP web framework based on Gin, inspired by nginx, openresty and beego.

Quick Start

create file myserver.go
package main

import (
	"github.com/opencurve/pigeon"
)

func main() {
	server := pigeon.NewHTTPServer()
	server.Route("/", func(r *pigeon.Request) bool {
		return r.Exit(200, "Hello Pigeon")
	})
	
	pigeon.Serve(server)
}
build and run
$ go build myserver.go
$ ./myserver start
access web server in default address
$ curl 127.0.0.1:8000
Hello Pigeon

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NewHTTPServer = http.NewHTTPServer
	NewPigeon     = core.NewPigeon
	Field         = log.Field

	HTTP_METHOD_GET    = consts.HTTP_METHOD_GET
	HTTP_METHOD_HEAD   = consts.HTTP_METHOD_HEAD
	HTTP_METHOD_PUT    = consts.HTTP_METHOD_PUT
	HTTP_METHOD_POST   = consts.HTTP_METHOD_POST
	HTTP_METHOD_DELETE = consts.HTTP_METHOD_DELETE

	HTTP_STATUS_CONTINUE              = consts.HTTP_STATUS_CONTINUE
	HTTP_STATUS_OK                    = consts.HTTP_STATUS_OK
	HTTP_STATUS_CREATED               = consts.HTTP_STATUS_CREATED
	HTTP_STATUS_MOVED_PERMANENTLY     = consts.HTTP_STATUS_MOVED_PERMANENTLY
	HTTP_STATUS_MOVED_TEMPORARILY     = consts.HTTP_STATUS_MOVED_TEMPORARILY
	HTTP_STATUS_NOT_MODIFIED          = consts.HTTP_STATUS_NOT_MODIFIED
	HTTP_STATUS_BAD_REQUEST           = consts.HTTP_STATUS_BAD_REQUEST
	HTTP_STATUS_UNAUTHORIZED          = consts.HTTP_STATUS_UNAUTHORIZED
	HTTP_STATUS_FORBIDDEN             = consts.HTTP_STATUS_FORBIDDEN
	HTTP_STATUS_NOT_FOUND             = consts.HTTP_STATUS_NOT_FOUND
	HTTP_STATUS_NOT_ALLOWED           = consts.HTTP_STATUS_NOT_ALLOWED
	HTTP_STATUS_INTERNAL_SERVER_ERROR = consts.HTTP_STATUS_INTERNAL_SERVER_ERROR
	HTTP_STATUS_BAD_GATEWAY           = consts.HTTP_STATUS_BAD_GATEWAY
	HTTP_STATUS_SERVICE_UNAVAILABLE   = consts.HTTP_STATUS_SERVICE_UNAVAILABLE
	HTTP_STATUS_GATEWAY_TIMEOUT       = consts.HTTP_STATUS_GATEWAY_TIMEOUT
)

Functions

func Serve

func Serve(servers ...*HTTPServer)

Types

type Configure

type Configure = configure.ServerConfigure

type HTTPServer

type HTTPServer = http.HTTPServer

type JSON

type JSON = gin.H

type Logger

type Logger = zap.Logger

type Pigeon

type Pigeon = core.Pigeon

type Request

type Request = http.Request

Directories

Path Synopsis
cli
cmd
internal
pkg
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL