transport_dummy

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyHandler

type DummyHandler func(c gnet.Conn, frame []byte)

type DummyReadHandler

type DummyReadHandler struct {
}

DummyReadHandler struct with MDBX database passed in

func NewDummyReadHandler

func NewDummyReadHandler(db db.Provider) *DummyReadHandler

NewDummyReadHandler creates a new UDSReadHandler with an MDBX database

func (*DummyReadHandler) HandleMessage

func (rh *DummyReadHandler) HandleMessage(c gnet.Conn, frame []byte)

HandleMessage processes the incoming message using the UDSReadHandler

type DummyWriteHandler

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

DummyWriteHandler struct with MDBX database passed in

func NewDummyWriteHandler

func NewDummyWriteHandler(db db.Provider) *DummyWriteHandler

NewDummyWriteHandler creates a new UDSWriteHandler with an MDBX database

func (*DummyWriteHandler) HandleMessage

func (wh *DummyWriteHandler) HandleMessage(c gnet.Conn, frame []byte)

HandleMessage processes the incoming message using the UDSWriteHandler

type Server

type Server struct {
	*gnet.EventServer
	// contains filtered or unexported fields
}

func NewDummyServer

func NewDummyServer(ctx context.Context, cnf config.DummyTransport) (*Server, error)

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the UDS socket path as a string

func (*Server) DeregisterHandler

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

DeregisterHandler deregisters a handler for a specific action

func (*Server) OnInitComplete

func (s *Server) OnInitComplete(server gnet.Server) (action gnet.Action)

OnInitComplete is called when the server starts

func (*Server) React

func (s *Server) React(frame []byte, c gnet.Conn) (out []byte, action gnet.Action)

React handles incoming data

func (*Server) RegisterHandler

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

RegisterHandler registers a handler for a specific action

func (*Server) Start

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

Start starts the UDS server

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the UDS server

func (*Server) Tick

func (s *Server) Tick() (delay time.Duration, action gnet.Action)

Tick is called periodically by gnet

func (*Server) WaitStarted

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

Jump to

Keyboard shortcuts

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