server

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 19 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) Start

func (s *Server) Start(bind 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