server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	Apply(svc *Server)
}

func WithMiddlewares

func WithMiddlewares(middlewares ...middleware.Middleware) Option

WithMiddlewares is the option that adds middlewares to the server.

Example:

WithMiddlewares(middleware.WithRecover())

type Server

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

Server is a struct to handle server

func New

func New(opt ...Option) (*Server, error)

New creates a new server

func NewWithDefaultConfig

func NewWithDefaultConfig(opt ...Option) (*Server, error)

NewWithDefaultConfig creates a new server with default config This config choosen by the author of the package

func (*Server) Listen

func (s *Server) Listen(address string, config ...fiber.ListenConfig) error

Listen starts the server with the given address and config

func (*Server) ListenGracefully

func (s *Server) ListenGracefully(address string, config ...fiber.ListenConfig) error

ListenGracefully starts the server with the given address and config It will shutdown the server gracefully when os.Interrupt, syscall.SIGTERM, or syscall.SIGQUIT signal is received It will return error if the server failed to start

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown shuts down the server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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