web

package
v0.0.0-...-362f400 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	server.Core
	// contains filtered or unexported fields
}

func Default

func Default(opts ...config.Option) *Engine

func (*Engine) Any

func (e *Engine) Any(relativePath string, handlers ...interface{}) router.IRoutes

Any registers a route for all HTTP methods with auto-detected handler type.

func (*Engine) DELETE

func (e *Engine) DELETE(relativePath string, handlers ...interface{}) router.IRoutes

DELETE registers a DELETE route with auto-detected handler type.

func (*Engine) GET

func (e *Engine) GET(relativePath string, handlers ...interface{}) router.IRoutes

GET registers a GET route with auto-detected handler type.

func (*Engine) GRPC

func (e *Engine) GRPC(httpMethod string, relativePath string, handler func(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error), srv interface{}) router.IRoutes

GRPC registers a gRPC route with the given HTTP method, protoc-generated handler and service instance.

func (*Engine) Group

func (e *Engine) Group(relativePath string, handlers ...app.HandlerFunc) *router.RouterGroup

Group creates a new router group with the given path prefix and optional middleware.

func (*Engine) HEAD

func (e *Engine) HEAD(relativePath string, handlers ...interface{}) router.IRoutes

HEAD registers a HEAD route with auto-detected handler type.

func (*Engine) Handle

func (e *Engine) Handle(httpMethod, relativePath string, handlers ...interface{}) router.IRoutes

Handle registers a route with a custom HTTP method.

func (*Engine) Handler

func (e *Engine) Handler() *router.Handler

Handler returns the underlying Handler for advanced usage.

func (*Engine) OPTIONS

func (e *Engine) OPTIONS(relativePath string, handlers ...interface{}) router.IRoutes

OPTIONS registers an OPTIONS route with auto-detected handler type.

func (*Engine) PATCH

func (e *Engine) PATCH(relativePath string, handlers ...interface{}) router.IRoutes

PATCH registers a PATCH route with auto-detected handler type.

func (*Engine) POST

func (e *Engine) POST(relativePath string, handlers ...interface{}) router.IRoutes

POST registers a POST route with auto-detected handler type.

func (*Engine) PUT

func (e *Engine) PUT(relativePath string, handlers ...interface{}) router.IRoutes

PUT registers a PUT route with auto-detected handler type.

func (*Engine) RouterGroup

func (e *Engine) RouterGroup() *router.RouterGroup

RouterGroup returns the root RouterGroup.

func (*Engine) Static

func (e *Engine) Static(relativePath, root string) router.IRoutes

Static serves files from the given file system root.

func (*Engine) StaticFS

func (e *Engine) StaticFS(relativePath string, fs *app.FS) router.IRoutes

StaticFS works just like Static() but a custom FS can be used instead.

func (*Engine) StaticFile

func (e *Engine) StaticFile(relativePath, filepath string) router.IRoutes

StaticFile registers a single route to serve a single file from the local filesystem.

func (*Engine) Use

func (e *Engine) Use(middleware ...app.HandlerFunc) router.IRoutes

Use adds middleware to the root router group.

Directories

Path Synopsis
app
common
bytestr
Package bytestr defines some common bytes
Package bytestr defines some common bytes
e
ext
http2
Package http2 implements the HTTP/2 protocol.
Package http2 implements the HTTP/2 protocol.
sse

Jump to

Keyboard shortcuts

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