server

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = "4040"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(s *Server)

func DisableSignatureVerification

func DisableSignatureVerification() Option

DisableSignatureVerification disables signature verification.

func DisableSwagger

func DisableSwagger() Option

DisableSwagger allows to disable the swagger setup of the server.

func WithPort

func WithPort(port string) Option

WithPort allows the server to run on a specified port.

type Server

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

func New

func New(
	provider servertypes.Provider, wCtx engine.Context, components []types.ComponentMetadata,
	messages []types.Message, queries []engine.Query, opts ...Option,
) (*Server, error)

New returns an HTTP server with handlers for all QueryTypes and MessageTypes.

func (*Server) BroadcastEvent

func (s *Server) BroadcastEvent(event any) error

func (*Server) Serve

func (s *Server) Serve() error

Serve serves the application, blocking the calling thread. Call this in a new go routine to prevent blocking.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown gracefully shuts down the server and closes all active websocket connections.

Directories

Path Synopsis
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
cql

Jump to

Keyboard shortcuts

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