Documentation ¶
Index ¶
- Variables
- func AppendResponse(a proto.AppendRequest, db *database.Database) proto.Message
- func CreateResponse(c proto.CreateTopicRequest, db *database.Database) proto.Message
- func ListResponse(l proto.ListRequest, db *database.Database, ...) proto.Message
- func NewDBStatsCollector(db *database.Database) prometheus.Collector
- func QueryResponse(q proto.QueryRequest, db *database.Database) proto.Message
- func VersionResponse(_ proto.VersionRequest) proto.Message
- type DatabaseConfig
- type MapMux
- type MessageHandler
- type MessageMux
- type MessageServer
- type MessageStateHandler
- type MetricsStore
- type Server
- func (s *Server) HandleAppend(rw proto.ResponseWriter, r *proto.Request)
- func (s *Server) HandleCreate(rw proto.ResponseWriter, r *proto.Request)
- func (s *Server) HandleList(rw proto.ResponseWriter, r *proto.Request)
- func (s *Server) HandleQuery(rw proto.ResponseWriter, r *proto.Request)
- func (s *Server) HandleStats(rw proto.ResponseWriter, r *proto.Request)
- func (s *Server) HandleUse(rw proto.ResponseWriter, c *conn, r *proto.Request)
- func (s *Server) HandleVersion(rw proto.ResponseWriter, r *proto.Request)
- func (s *Server) ServeDatabase()
- func (s *Server) ServeMetrics()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DatabaseLabel = "database" CommandLabel = "cmd" )
Functions ¶
func AppendResponse ¶ added in v0.2.0
func CreateResponse ¶ added in v0.2.0
func ListResponse ¶ added in v0.2.0
func NewDBStatsCollector ¶ added in v0.2.0
func NewDBStatsCollector(db *database.Database) prometheus.Collector
func QueryResponse ¶ added in v0.2.0
func VersionResponse ¶ added in v0.2.0
func VersionResponse(_ proto.VersionRequest) proto.Message
Types ¶
type DatabaseConfig ¶
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 ¶
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, metricsStore MetricsStore) 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 { Registry() *prometheus.Registry RegisterCollector(c prometheus.Collector) Handler() http.Handler // Collection IncClientConnection() IncRequests(db, cmd string) ObserveResponseNS(db, cmd string, t int64) }
func NewMetricsStore ¶
func NewMetricsStore() MetricsStore
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) HandleAppend ¶
func (s *Server) HandleAppend(rw proto.ResponseWriter, r *proto.Request)
func (*Server) HandleCreate ¶ added in v0.2.0
func (s *Server) HandleCreate(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()
Click to show internal directories.
Click to hide internal directories.