server

package
v0.0.0-...-f429fcc Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatusText

func StatusText(code int) string

Types

type HttpController

type HttpController interface {
	ApplyHTTP(group *echo.Group)
}

type HttpRender

type HttpRender struct {
	// contains filtered or unexported fields
}

func NewHttpRenderFromFS

func NewHttpRenderFromFS(fs fs.FS, dir string) *HttpRender

func (*HttpRender) Render

func (t *HttpRender) Render(w io.Writer, name string, data interface{}, c echo.Context) error

type HttpServer

type HttpServer struct {
	*echo.Echo
	// contains filtered or unexported fields
}

func NewHttpServer

func NewHttpServer(opts ...Option) *HttpServer

func (*HttpServer) Start

func (s *HttpServer) Start(host, port string) error

type Option

type Option func(server *HttpServer)

func WithControllers

func WithControllers(controllers ...HttpController) Option

func WithCors

func WithCors(enable bool) Option

func WithErrorHandler

func WithErrorHandler(handler echo.HTTPErrorHandler) Option

func WithHideBanner

func WithHideBanner() Option

func WithHidePort

func WithHidePort() Option

func WithPrefix

func WithPrefix(prefix string) Option

func WithRender

func WithRender(render echo.Renderer) Option

func WithValidator

func WithValidator(validator echo.Validator) Option

type Wrap

type Wrap struct {
	// contains filtered or unexported fields
}

func NewWrap

func NewWrap(prefix string, controllers ...HttpController) *Wrap

func (*Wrap) ApplyHTTP

func (w *Wrap) ApplyHTTP(group *echo.Group)

func (*Wrap) Use

func (w *Wrap) Use(middlewares ...echo.MiddlewareFunc) *Wrap

Jump to

Keyboard shortcuts

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