server

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: LGPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

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 disables the Swagger setup of the server.

func WithHashCacheSize added in v1.7.0

func WithHashCacheSize(sizeKB uint) Option

WithHashCacheSize how big the cache of hashes used for replay protection is allowed to be. Default is 1MB. This setting is ignored if the DisableSignatureVerification option is used

func WithMessageExpiration added in v1.7.0

func WithMessageExpiration(seconds uint) Option

WithMessageExpiration How long messages will live past their creation time on the sender before they are considered to be expired and will not be processed. Default is 10 seconds. For longer expiration times you may also need to set a larger hash cache size using the WithHashCacheSize option This setting is ignored if the DisableSignatureVerification option is used NOTE: this means that the real time clock for the sender and receiver must be synchronized

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(
	world servertypes.ProviderWorld,
	components []types.ComponentMetadata,
	messages []types.Message,
	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(ctx context.Context) error

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

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