transport_quic

package
v0.0.0-...-b45fe33 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QuicHandler

type QuicHandler func(sess quic.Connection, stream quic.Stream, message *messages.Message)

QuicHandler function type for QUIC

type QuicReadHandler

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

QuicReadHandler struct with MDBX database passed in

func NewQuicReadHandler

func NewQuicReadHandler(db db.Provider) *QuicReadHandler

NewQuicReadHandler creates a new QuicReadHandler with an MDBX database

func (*QuicReadHandler) HandleMessage

func (rh *QuicReadHandler) HandleMessage(conn quic.Connection, stream quic.Stream, message *messages.Message)

HandleMessage processes the incoming message using the QuicReadHandler

type QuicWriteHandler

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

QuicWriteHandler struct with MDBX database passed in

func NewQuicWriteHandler

func NewQuicWriteHandler(db db.Provider, batchWriter *db.BatchWriter) *QuicWriteHandler

NewQuicWriteHandler creates a new QuicWriteHandler with an MDBX database

func (*QuicWriteHandler) HandleMessage

func (wh *QuicWriteHandler) HandleMessage(conn quic.Connection, stream quic.Stream, message *messages.Message)

HandleMessage processes the incoming message using the QuicWriteHandler

type Server

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

Server struct represents the QUIC server

func NewServer

func NewServer(ctx context.Context, cnf config.QuicTransport) (*Server, error)

NewServer creates a new QuicServer instance

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the server address as a string.

func (*Server) DeregisterHandler

func (s *Server) DeregisterHandler(actionType types.HandlerType)

DeregisterHandler deregisters a handler for a specific action

func (*Server) RegisterHandler

func (s *Server) RegisterHandler(actionType types.HandlerType, handler QuicHandler)

RegisterHandler registers a handler for a specific action

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the QUIC server

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the QUIC server

func (*Server) WaitStarted

func (s *Server) WaitStarted() <-chan struct{}

WaitStarted returns a channel that is closed when the server has started

Jump to

Keyboard shortcuts

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