gin

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 18 Imported by: 19

Documentation

Overview

Package gin provides some basic implementations for building routers based on gin-gonic/gin

Index

Constants

View Source
const NEGOTIATE = "negotiate"
View Source
const Namespace = "github.com/starvn/turbo/route/gin"

Variables

Functions

func DebugHandler

func DebugHandler(logger log.Logger) gin.HandlerFunc

func DefaultFactory

func DefaultFactory(proxyFactory proxy.Factory, logger log.Logger) route.Factory

func NewEngine

func NewEngine(cfg config.ServiceConfig, logger log.Logger, w io.Writer) *gin.Engine

func NewFactory

func NewFactory(cfg Config) route.Factory

func NewRequest

func NewRequest(headersToSend []string) func(*gin.Context, []string) *proxy.Request

func RegisterRender

func RegisterRender(name string, r Render)

Types

type Config

type Config struct {
	Engine         *gin.Engine
	Middlewares    []gin.HandlerFunc
	HandlerFactory HandlerFactory
	ProxyFactory   proxy.Factory
	Logger         log.Logger
	RunServer      RunServerFunc
}

type HandlerFactory

type HandlerFactory func(*config.EndpointConfig, proxy.Proxy) gin.HandlerFunc

func CustomErrorEndpointHandler

func CustomErrorEndpointHandler(logger log.Logger, errF server.ToHTTPError) HandlerFactory

type Render

type Render func(*gin.Context, *proxy.Response)

Jump to

Keyboard shortcuts

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