Documentation
¶
Overview ¶
gonest/platform/chi.go
gonest/platform/echo.go
gonest/platform/fiber.go
gonest/platform/gin.go
gonest/platform/mux.go
gonest/platform/types.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdapterConfig ¶
AdapterConfig configures an adapter
type ChiAdapter ¶
type ChiAdapter struct {
// contains filtered or unexported fields
}
ChiAdapter implements PlatformAdapter for Chi router
func NewChiAdapter ¶
func NewChiAdapter(config ...*AdapterConfig) *ChiAdapter
NewChiAdapter creates a Chi adapter
func (*ChiAdapter) GetRouter ¶
func (a *ChiAdapter) GetRouter() *chi.Mux
GetRouter returns the underlying Chi router for advanced configuration
func (*ChiAdapter) Handler ¶
func (a *ChiAdapter) Handler() http.Handler
Handler returns the http.Handler for the platform
func (*ChiAdapter) RegisterRoute ¶
func (a *ChiAdapter) RegisterRoute(route core.RouteDefinition) error
RegisterRoute registers a route with the platform
func (*ChiAdapter) Use ¶
func (a *ChiAdapter) Use(middleware core.MiddlewareFunc)
Use registers global middleware
type DefaultLogger ¶
type DefaultLogger struct{}
DefaultLogger provides basic logging
func (*DefaultLogger) Debug ¶
func (l *DefaultLogger) Debug(_ string, _ ...any)
func (*DefaultLogger) Error ¶
func (l *DefaultLogger) Error(_ string, _ ...any)
func (*DefaultLogger) Info ¶
func (l *DefaultLogger) Info(_ string, _ ...any)
type EchoAdapter ¶
type EchoAdapter struct {
// contains filtered or unexported fields
}
EchoAdapter implements PlatformAdapter for Echo framework
func NewEchoAdapter ¶
func NewEchoAdapter(config ...*AdapterConfig) *EchoAdapter
NewEchoAdapter creates an Echo adapter
func (*EchoAdapter) GetEcho ¶
func (a *EchoAdapter) GetEcho() *echo.Echo
GetEcho returns the underlying Echo instance for advanced configuration
func (*EchoAdapter) Handler ¶
func (a *EchoAdapter) Handler() http.Handler
Handler returns the http.Handler for the platform
func (*EchoAdapter) RegisterRoute ¶
func (a *EchoAdapter) RegisterRoute(route core.RouteDefinition) error
RegisterRoute registers a route with the platform
func (*EchoAdapter) Use ¶
func (a *EchoAdapter) Use(middleware core.MiddlewareFunc)
Use registers global middleware
type FiberAdapter ¶
type FiberAdapter struct {
// contains filtered or unexported fields
}
FiberAdapter implements PlatformAdapter for Fiber framework
func NewFiberAdapter ¶
func NewFiberAdapter(config ...*AdapterConfig) *FiberAdapter
NewFiberAdapter creates a Fiber adapter
func (*FiberAdapter) GetApp ¶
func (a *FiberAdapter) GetApp() *fiber.App
GetApp returns the underlying Fiber app for advanced configuration
func (*FiberAdapter) Handler ¶
func (a *FiberAdapter) Handler() http.Handler
Handler returns the http.Handler for the platform Fiber uses fasthttp, so we need to adapt it to net/http
func (*FiberAdapter) RegisterRoute ¶
func (a *FiberAdapter) RegisterRoute(route core.RouteDefinition) error
RegisterRoute registers a route with the platform
func (*FiberAdapter) Use ¶
func (a *FiberAdapter) Use(middleware core.MiddlewareFunc)
Use registers global middleware
type GinAdapter ¶
type GinAdapter struct {
// contains filtered or unexported fields
}
GinAdapter implements PlatformAdapter for Gin framework
func NewGinAdapter ¶
func NewGinAdapter(config ...*AdapterConfig) *GinAdapter
NewGinAdapter creates a Gin adapter
func (*GinAdapter) GetEngine ¶
func (a *GinAdapter) GetEngine() *gin.Engine
GetEngine returns the underlying Gin engine for advanced configuration
func (*GinAdapter) Handler ¶
func (a *GinAdapter) Handler() http.Handler
Handler returns the http.Handler for the platform
func (*GinAdapter) RegisterRoute ¶
func (a *GinAdapter) RegisterRoute(route core.RouteDefinition) error
RegisterRoute registers a route with the platform
func (*GinAdapter) Use ¶
func (a *GinAdapter) Use(middleware core.MiddlewareFunc)
Use registers global middleware
type Logger ¶
type Logger interface {
Info(msg string, args ...any)
Error(msg string, args ...any)
Debug(msg string, args ...any)
}
Logger interface for adapters
type MuxAdapter ¶
type MuxAdapter struct {
// contains filtered or unexported fields
}
MuxAdapter implements PlatformAdapter for standard net/http
func NewMuxAdapter ¶
func NewMuxAdapter(config ...*AdapterConfig) *MuxAdapter
NewMuxAdapter creates a standard net/http adapter
func (*MuxAdapter) Handler ¶
func (a *MuxAdapter) Handler() http.Handler
Handler returns the http.Handler for the platform
func (*MuxAdapter) RegisterRoute ¶
func (a *MuxAdapter) RegisterRoute(route core.RouteDefinition) error
RegisterRoute registers a route with the platform
func (*MuxAdapter) Use ¶
func (a *MuxAdapter) Use(middleware core.MiddlewareFunc)
Use registers global middleware
type PlatformAdapter ¶
type PlatformAdapter interface {
// Name returns the platform name
Name() string
// RegisterRoute registers a route with the platform
RegisterRoute(route core.RouteDefinition) error
// Handler returns the http.Handler for the platform
Handler() http.Handler
// Use registers global middleware
Use(middleware core.MiddlewareFunc)
}
PlatformAdapter defines the interface for platform adapters This is implemented by each framework adapter (Gin, Fiber, Echo, etc)