server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseConfig

type DatabaseConfig struct {
	Name      string
	Directory string
}

type MapMux

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

func (*MapMux) Handle

func (mm *MapMux) Handle(s string, f MessageHandler)

func (*MapMux) HandleState

func (mm *MapMux) HandleState(s string, f MessageStateHandler)

func (*MapMux) ServeMessage

func (mm *MapMux) ServeMessage(c *conn, r *proto.Request)

type MessageHandler

type MessageHandler func(proto.ResponseWriter, *proto.Request)

type MessageMux

type MessageMux interface {
	ServeMessage(c *conn, r *proto.Request)
	Handle(s string, f MessageHandler)
	HandleState(s string, f MessageStateHandler)
}

func NewMapMux

func NewMapMux() MessageMux

type MessageServer

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

func NewMessageServer

func NewMessageServer(log zerolog.Logger) MessageServer

func (*MessageServer) ListenAndServe

func (ms *MessageServer) ListenAndServe(port int, mux MessageMux) error

type MessageStateHandler

type MessageStateHandler func(proto.ResponseWriter, *conn, *proto.Request)

type MetricsStore

type MetricsStore interface {
	IncClientConnection()
}

func NewMetricsStore

func NewMetricsStore() MetricsStore

type Server

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

func New

func New(log zerolog.Logger, dbConfigs map[string]DatabaseConfig, port, metricsPort int) Server

func (*Server) HandleAppend

func (s *Server) HandleAppend(rw proto.ResponseWriter, r *proto.Request)

func (*Server) HandleList

func (s *Server) HandleList(rw proto.ResponseWriter, r *proto.Request)

func (*Server) HandleQuery

func (s *Server) HandleQuery(rw proto.ResponseWriter, r *proto.Request)

func (*Server) HandleStats

func (s *Server) HandleStats(rw proto.ResponseWriter, r *proto.Request)

func (*Server) HandleUse

func (s *Server) HandleUse(rw proto.ResponseWriter, c *conn, r *proto.Request)

func (*Server) HandleVersion

func (s *Server) HandleVersion(rw proto.ResponseWriter, r *proto.Request)

func (*Server) ServeDatabase

func (s *Server) ServeDatabase()

func (*Server) ServeMetrics

func (s *Server) ServeMetrics()

Jump to

Keyboard shortcuts

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