server

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options added in v1.21.0

type Options struct {
	// RequestLimit is a number of requests per second for each IP.
	// If value is 0, rate limit is disabled.
	RequestLimit uint64

	// RequestLimitSkipper defines a function to skip request rate limiting based on custom logic.
	RequestLimitSkipper middleware.Skipper

	// RequestLimitTimeWindow is a period of requests limit in seconds.
	// If value is 0, rate limit is set default value.
	RequestLimitTimeWindow uint64

	// BodyLimit sets the maximum allowed size for the request body.
	// If set to the empty string (`""`), no body size limit is enforced.
	// Accepted formats are an integer followed by an optional unit, e.g. `4K`, `4KB`, `10M`, `1G`.
	// Supported units: K, M, G, T, P (optionally followed by `B`), case-insensitive.
	BodyLimit string
}

Options is a set of options for server.

type Route added in v1.8.0

type Route interface {
	Use(e *echo.Echo)
}

type Server

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

Server is HTTP server that wraps Ferret worker.

func New

func New(logger *lecho.Logger, opts Options) (*Server, error)

func (*Server) Router added in v1.8.0

func (s *Server) Router() *echo.Echo

func (*Server) Run

func (s *Server) Run(port uint64) error

Run start server that serve at the given port.

Port should not begin with ":".

Jump to

Keyboard shortcuts

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