websocket

package
v30.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(apiSvr *api.Server, sk *keeper.Keeper, homePath string) error

RegisterRoutes registers WebSocket routes for the stream module using the configuration loaded from the node's home directory.

Types

type Config

type Config struct {
	CORSAllowedOrigins []string
}

Config contains the runtime configuration for the websocket server

func LoadConfig

func LoadConfig(homePath string) (Config, error)

LoadConfig reads the websocket configuration from app.toml located under the node's home directory

type Server

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

Server wraps the WebSocket handler together with its supporting components.

func NewServer

func NewServer(opts ServerOptions) *Server

NewServer constructs a WebSocket server for the stream module using the provided options.

func (*Server) HasRoutes

func (s *Server) HasRoutes() bool

HasRoutes reports whether the server produced any websocket routes.

func (*Server) RegisterRoutes

func (s *Server) RegisterRoutes(register func(pattern string, handler http.Handler))

RegisterRoutes registers all WebSocket routes with the provided function.

type ServerOptions

type ServerOptions struct {
	ContextDone    <-chan struct{}
	MethodRegistry *encoding.DynamicRegistry
	Registry       *types.SubscriptionRegistry
	Invoker        *types.RouterInvoker
	Logger         log.Logger
	Upgrader       *websocket.Upgrader
}

ServerOptions contains the configuration required to build a WebSocket server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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