ironhawk

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMaxClientsReached = errors.New("maximum number of clients reached")
	ErrIOThreadNotFound  = errors.New("io-thread not found")
)
View Source
var (
	ErrRequestTooLarge = errors.New("request too large")
	ErrIdleTimeout     = errors.New("connection idle timeout")
	ErrorClosed        = errors.New("connection closed")
)

Functions

This section is empty.

Types

type IOHandler

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

IOHandler handles I/O operations for a network connection

func NewIOHandler

func NewIOHandler(clientFD int) (*IOHandler, error)

NewIOHandler creates a new IOHandler from a file descriptor

func NewIOHandlerWithConn

func NewIOHandlerWithConn(conn net.Conn) *IOHandler

func (*IOHandler) Close

func (h *IOHandler) Close() error

Close underlying network connection

func (*IOHandler) Read

func (h *IOHandler) Read(ctx context.Context) ([]byte, error)

ReadRequest reads data from the network connection

func (*IOHandler) ReadSync

func (h *IOHandler) ReadSync() (*wire.Command, error)

ReadRequest reads data from the network connection

func (*IOHandler) Write

func (h *IOHandler) Write(ctx context.Context, r interface{}) error

func (*IOHandler) WriteSync

func (h *IOHandler) WriteSync(ctx context.Context, r *wire.Result) error

type IOThread

type IOThread struct {
	ClientID  string
	Mode      string
	IoHandler *IOHandler
	Session   *auth.Session
}

func NewIOThread

func NewIOThread(clientFD int) (*IOThread, error)

func (*IOThread) StartSync

func (t *IOThread) StartSync(ctx context.Context, shardManager *shardmanager.ShardManager, watchManager *WatchManager) error

func (*IOThread) Stop

func (t *IOThread) Stop() error

type IOThreadManager

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

func NewIOThreadManager

func NewIOThreadManager() *IOThreadManager

func (*IOThreadManager) IOThreadCount

func (m *IOThreadManager) IOThreadCount() uint32

func (*IOThreadManager) RegisterIOThread

func (m *IOThreadManager) RegisterIOThread(ioThread *IOThread) error

func (*IOThreadManager) UnregisterIOThread

func (m *IOThreadManager) UnregisterIOThread(id string) error

type Server

type Server struct {
	Host string
	Port int
	// contains filtered or unexported fields
}

func NewServer

func NewServer(shardManager *shardmanager.ShardManager, ioThreadManager *IOThreadManager, watchManager *WatchManager) *Server

func (*Server) AcceptConnectionRequests

func (s *Server) AcceptConnectionRequests(ctx context.Context, wg *sync.WaitGroup) error

func (*Server) BindAndListen

func (s *Server) BindAndListen() error

func (*Server) Run

func (s *Server) Run(ctx context.Context) (err error)

func (*Server) Shutdown

func (s *Server) Shutdown()

type WatchManager

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

func NewWatchManager

func NewWatchManager() *WatchManager

func (*WatchManager) CleanupThreadWatchSubscriptions

func (w *WatchManager) CleanupThreadWatchSubscriptions(t *IOThread)

func (*WatchManager) HandleUnwatch

func (w *WatchManager) HandleUnwatch(c *cmd.Cmd, t *IOThread)

func (*WatchManager) HandleWatch

func (w *WatchManager) HandleWatch(c *cmd.Cmd, t *IOThread)

func (*WatchManager) NotifyWatchers

func (w *WatchManager) NotifyWatchers(c *cmd.Cmd, shardManager *shardmanager.ShardManager, t *IOThread)

func (*WatchManager) RegisterThread

func (w *WatchManager) RegisterThread(t *IOThread)

Jump to

Keyboard shortcuts

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