Documentation
¶
Overview ¶
Package web provides a set of templates for the specified web router.
Package web provides a set of templates for the specified web router.
Package web provides a set of templates for the specified web router.
Package web provides a set of templates for the specified web router.
Package web provides a set of templates for the specified web router.
Package web provides a set of templates for the specified web router.
Package web provides a set of templates for the specified web router.
Package web provides a set of templates for the specified web router.
Index ¶
- func MakeChiRoutes() []byte
- func MakeEchoRoutes() []byte
- func MakeFiberMain() []byte
- func MakeFiberRoutes() []byte
- func MakeFiberServer() []byte
- func MakeGinRoutes() []byte
- func MakeGorillaRoutes() []byte
- func MakeHTTPRoutes() []byte
- func MakeHTTPServer() []byte
- func MakeRouterRoutes() []byte
- type ChiTemplate
- type EchoTemplate
- type FiberTemplate
- type GinTemplate
- type GorillaTemplate
- type HttpRouterTemplate
- type StandardLibraryTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeChiRoutes ¶
func MakeChiRoutes() []byte
MakeChiRoutes returns a byte slice containing a Go source code template for a Chi router. The template includes a function to register routes and a hello world handler.
func MakeEchoRoutes ¶
func MakeEchoRoutes() []byte
MakeEchoRoutes returns a byte slice containing a Go source code template for an Echo router. The template includes a function to register routes and a hello world handler.
func MakeFiberMain ¶
func MakeFiberMain() []byte
MakeFiberMain returns a byte slice containing a Go source code template for the main function. The main function creates a new Fiber server, registers the routes, and starts the server.
func MakeFiberRoutes ¶
func MakeFiberRoutes() []byte
MakeFiberRoutes returns a byte slice containing a Go source code template for Fiber routes. The template includes a function to register a hello world handler to the root path.
func MakeFiberServer ¶
func MakeFiberServer() []byte
MakeFiberServer returns a byte slice containing a Go source code template for a Fiber server. The server is created with a new Fiber app.
func MakeGinRoutes ¶
func MakeGinRoutes() []byte
MakeGinRoutes returns a byte slice containing a Go source code template for Gin routes. The template includes a function to register a hello world handler to the root path.
func MakeGorillaRoutes ¶
func MakeGorillaRoutes() []byte
MakeGorillaRoutes returns a byte slice containing a Go source code template for Gorilla routes. The template includes a function to register a hello world handler to the root path.
func MakeHTTPRoutes ¶
func MakeHTTPRoutes() []byte
MakeHTTPRoutes returns a byte slice containing a Go source code template for standard library HTTP routes. The template includes a function to register a hello world handler to the root path.
func MakeHTTPServer ¶
func MakeHTTPServer() []byte
MakeHTTPServer returns a byte slice containing a Go source code template for an HTTP server. The server is configured with a port number and timeouts, and it uses the routes registered by the Server struct.
func MakeRouterRoutes ¶
func MakeRouterRoutes() []byte
MakeRouterRoutes returns a byte slice containing a Go source code template for HttpRouter routes. The template includes a function to register a hello world handler to the root path.
Types ¶
type ChiTemplate ¶
type ChiTemplate struct{}
ChiTemplate is a struct that provides methods to generate templates for a Chi-based HTTP server.
func (ChiTemplate) Main ¶
func (c ChiTemplate) Main() []byte
Main returns the main template for the Chi-based HTTP server.
func (ChiTemplate) Routes ¶
func (c ChiTemplate) Routes() []byte
Routes returns the routes template for the Chi-based HTTP server.
func (ChiTemplate) Server ¶
func (c ChiTemplate) Server() []byte
Server returns the server template for the Chi-based HTTP server.
type EchoTemplate ¶
type EchoTemplate struct{}
EchoTemplate is a struct that provides methods to generate templates for an Echo-based HTTP server.
func (EchoTemplate) Main ¶
func (e EchoTemplate) Main() []byte
Main returns the main template for the Echo-based HTTP server.
func (EchoTemplate) Routes ¶
func (e EchoTemplate) Routes() []byte
Routes returns the routes template for the Echo-based HTTP server.
func (EchoTemplate) Server ¶
func (e EchoTemplate) Server() []byte
Server returns the server template for the Echo-based HTTP server.
type FiberTemplate ¶
type FiberTemplate struct{}
FiberTemplate is a struct that provides methods to generate templates for a Fiber-based HTTP server.
func (FiberTemplate) Main ¶
func (c FiberTemplate) Main() []byte
Main returns the main template for the Fiber-based HTTP server.
func (FiberTemplate) Routes ¶
func (c FiberTemplate) Routes() []byte
Routes returns the routes template for the Fiber-based HTTP server.
func (FiberTemplate) Server ¶
func (c FiberTemplate) Server() []byte
Server returns the server template for the Fiber-based HTTP server.
type GinTemplate ¶
type GinTemplate struct{}
GinTemplate is a struct that provides methods to generate templates for a Gin-based HTTP server.
func (GinTemplate) Main ¶
func (c GinTemplate) Main() []byte
Main returns the main template for the Gin-based HTTP server.
func (GinTemplate) Routes ¶
func (c GinTemplate) Routes() []byte
Routes returns the routes template for the Gin-based HTTP server.
func (GinTemplate) Server ¶
func (c GinTemplate) Server() []byte
Server returns the server template for the Gin-based HTTP server.
type GorillaTemplate ¶
type GorillaTemplate struct{}
GorillaTemplate is a struct that provides methods to generate templates for a Gorilla-based HTTP server.
func (GorillaTemplate) Main ¶
func (c GorillaTemplate) Main() []byte
Main returns the main template for the Gorilla-based HTTP server.
func (GorillaTemplate) Routes ¶
func (c GorillaTemplate) Routes() []byte
Routes returns the routes template for the Gorilla-based HTTP server.
func (GorillaTemplate) Server ¶
func (c GorillaTemplate) Server() []byte
Server returns the server template for the Gorilla-based HTTP server.
type HttpRouterTemplate ¶
type HttpRouterTemplate struct{}
HttpRouterTemplate is a struct that provides methods to generate templates for a HttpRouter-based HTTP server.
func (HttpRouterTemplate) Main ¶
func (c HttpRouterTemplate) Main() []byte
Main returns the main template for the HttpRouter-based HTTP server.
func (HttpRouterTemplate) Routes ¶
func (c HttpRouterTemplate) Routes() []byte
Routes returns the routes template for the HttpRouter-based HTTP server.
func (HttpRouterTemplate) Server ¶
func (c HttpRouterTemplate) Server() []byte
Server returns the server template for the HttpRouter-based HTTP server.
type StandardLibraryTemplate ¶
type StandardLibraryTemplate struct{}
StandardLibraryTemplate is a struct that provides methods to generate templates for a standard library-based HTTP server.
func (StandardLibraryTemplate) Main ¶
func (c StandardLibraryTemplate) Main() []byte
Main returns the main template for the standard library-based HTTP server.
func (StandardLibraryTemplate) Routes ¶
func (c StandardLibraryTemplate) Routes() []byte
Routes returns the routes template for the standard library-based HTTP server.
func (StandardLibraryTemplate) Server ¶
func (c StandardLibraryTemplate) Server() []byte
Server returns the server template for the standard library-based HTTP server.