server

package
v1.0.0-rc10 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 21 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 WithAdditionalRPC

func WithAdditionalRPC(fnName string, fn interface{}) Option

WithAdditionalRPC adds an RPC function to 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

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