server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package server provides the XxSql server implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePIDFile

func CreatePIDFile(path string) error

CreatePIDFile creates a PID file.

func RemovePIDFile

func RemovePIDFile(path string)

RemovePIDFile removes the PID file.

Types

type HTTPServer

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

HTTPServer wraps the HTTP API server.

func NewHTTPServer

func NewHTTPServer(server *Server, bind string, port int) *HTTPServer

NewHTTPServer creates a new HTTP server.

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start starts the HTTP server.

func (*HTTPServer) Stop

func (s *HTTPServer) Stop() error

Stop stops the HTTP server.

type MySQLServer

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

MySQLServer wraps the MySQL protocol server.

func NewMySQLServer

func NewMySQLServer(server *Server, bind string, port int) *MySQLServer

NewMySQLServer creates a new MySQL server.

func (*MySQLServer) Start

func (s *MySQLServer) Start() error

Start starts the MySQL server.

func (*MySQLServer) Stop

func (s *MySQLServer) Stop() error

Stop stops the MySQL server.

type Server

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

Server represents the XxSql server.

func New

func New(cfg *config.Config, logger *log.Logger, engine *storage.Engine) *Server

New creates a new XxSql server.

func (*Server) Auth

func (s *Server) Auth() *auth.Manager

Auth returns the auth manager.

func (*Server) GetStats

func (s *Server) GetStats() ServerStats

GetStats returns server statistics.

func (*Server) IsRunning

func (s *Server) IsRunning() bool

IsRunning returns whether the server is running.

func (*Server) Logger

func (s *Server) Logger() *log.Logger

Logger returns the logger.

func (*Server) Start

func (s *Server) Start() error

Start starts the server.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the server.

func (*Server) Uptime

func (s *Server) Uptime() time.Duration

Uptime returns the server uptime.

type ServerStats

type ServerStats struct {
	TotalConnections  uint64
	ActiveConnections uint64
	TotalQueries      uint64
	QueriesPerSecond  uint64
	LastQueryTime     time.Time
}

ServerStats holds server statistics.

Jump to

Keyboard shortcuts

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