server

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package server represents the webserver that powers S&D.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(s *Server) error

Option represent an configuration option for the server.

func WithAdditionalRoutes added in v1.0.1

func WithAdditionalRoutes(routes ...func(e *echo.Group)) Option

WithAdditionalRoutes adds additional routes to the server.

func WithDataDir added in v1.0.1

func WithDataDir(dir string) Option

WithDataDir sets the data directory of the Server.

func WithDebug

func WithDebug(value bool) Option

WithDebug sets the debug state of the Server.

func WithPrinter

func WithPrinter(printer printing.Printer) Option

WithPrinter registers a printer in the Server.

type Server

type Server struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Server represents an instance of the S&D server.

func New

func New(db database.Database, options ...Option) (*Server, error)

New creates a new instance of the S&D server.

func (*Server) Close added in v1.0.1

func (s *Server) Close() error

Close closes the server and all its connections.

func (*Server) Start

func (s *Server) Start(bindAddr string) error

Start starts the server with the given bind address.

Examples: - ":7232" will accept all connections on port 7232 - "127.0.0.1:7232" will only accept local connections on port 7232

Jump to

Keyboard shortcuts

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