server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouterBuilder

type RouterBuilder func(app *core.Application, config *entities.Config, logger ports.LoggerPort, fiberapp *fiber.App) error

RouterBuilder is a function that builds the router. The function is called with the application, the config and the fiber app. The function should return an error if something went wrong.

type Server

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

Server represents the server.

func NewServer

func NewServer(config *entities.Config, app *core.Application, logger ports.LoggerPort) *Server

NewServer creates a new server. The server is not started. The server is created with the given config and application.

func (*Server) CreateDefaultRouter

func (s *Server) CreateDefaultRouter() error

CreateDefaultRouter creates the default router. The default router serves the static files from the theme. Registers routes for all pages.

func (*Server) CreateRouter

func (s *Server) CreateRouter(builder RouterBuilder) error

CreateRouter creates the router with the given builder. The builder is called with the application, the config and the fiber app. The builder should return an error if something went wrong.

func (*Server) Start

func (s *Server) Start() error

Start starts the server.

Jump to

Keyboard shortcuts

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