Documentation
¶
Index ¶
- type Server
- func (s *Server) HandleTSAggregate(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSAppend(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSBatchAppend(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSDefineTimeline(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSGetRetention(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSGetTimeline(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSLatest(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSListTimelines(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSProvision(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSQueryRange(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSStats(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSTimelineStats(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTSUpdateTimeline(w http.ResponseWriter, r *http.Request)
- func (s *Server) Handler() http.Handler
- func (s *Server) MarkReady()
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) Start() error
- func (s *Server) Stop()
- func (s *Server) TenantRegistry() *tenant.Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP server
func New ¶
func New( cfg *config.Config, store storage.Store, cache cache.Cache, g graph.Graph, persister *graph.AdaptivePersister, validator validation.Validator, logger zerolog.Logger, ) *Server
New creates a new server instance
func (*Server) HandleTSAggregate ¶
func (s *Server) HandleTSAggregate(w http.ResponseWriter, r *http.Request)
HandleTSAggregate computes an aggregate over a numeric field.
POST /api/v1/tenant/{tenant_id}/ts/aggregate
func (*Server) HandleTSAppend ¶
func (s *Server) HandleTSAppend(w http.ResponseWriter, r *http.Request)
HandleTSAppend appends a single event.
POST /api/v1/tenant/{tenant_id}/ts/events
func (*Server) HandleTSBatchAppend ¶
func (s *Server) HandleTSBatchAppend(w http.ResponseWriter, r *http.Request)
HandleTSBatchAppend appends a batch of events atomically.
POST /api/v1/tenant/{tenant_id}/ts/events/batch
func (*Server) HandleTSDefineTimeline ¶
func (s *Server) HandleTSDefineTimeline(w http.ResponseWriter, r *http.Request)
HandleTSDefineTimeline defines or updates a timeline.
POST /api/v1/tenant/{tenant_id}/ts/timelines
func (*Server) HandleTSGetRetention ¶
func (s *Server) HandleTSGetRetention(w http.ResponseWriter, r *http.Request)
HandleTSGetRetention returns the retention configuration.
GET /api/v1/tenant/{tenant_id}/ts/retention
func (*Server) HandleTSGetTimeline ¶
func (s *Server) HandleTSGetTimeline(w http.ResponseWriter, r *http.Request)
HandleTSGetTimeline returns a single timeline.
GET /api/v1/tenant/{tenant_id}/ts/timelines/{timeline_id}
func (*Server) HandleTSLatest ¶
func (s *Server) HandleTSLatest(w http.ResponseWriter, r *http.Request)
HandleTSLatest returns the N most recent events.
GET /api/v1/tenant/{tenant_id}/ts/events/latest
func (*Server) HandleTSListTimelines ¶
func (s *Server) HandleTSListTimelines(w http.ResponseWriter, r *http.Request)
HandleTSListTimelines returns all defined timelines.
GET /api/v1/tenant/{tenant_id}/ts/timelines
func (*Server) HandleTSProvision ¶
func (s *Server) HandleTSProvision(w http.ResponseWriter, r *http.Request)
HandleTSProvision provisions timeseries for a tenant.
POST /api/v1/tenant/{tenant_id}/ts/provision
func (*Server) HandleTSQueryRange ¶
func (s *Server) HandleTSQueryRange(w http.ResponseWriter, r *http.Request)
HandleTSQueryRange returns events in a time range.
GET /api/v1/tenant/{tenant_id}/ts/events
func (*Server) HandleTSStats ¶
func (s *Server) HandleTSStats(w http.ResponseWriter, r *http.Request)
HandleTSStats returns store-level diagnostics.
GET /api/v1/tenant/{tenant_id}/ts/stats
func (*Server) HandleTSTimelineStats ¶
func (s *Server) HandleTSTimelineStats(w http.ResponseWriter, r *http.Request)
HandleTSTimelineStats returns per-timeline diagnostics.
GET /api/v1/tenant/{tenant_id}/ts/stats/{timeline_id}
func (*Server) HandleTSUpdateTimeline ¶
func (s *Server) HandleTSUpdateTimeline(w http.ResponseWriter, r *http.Request)
HandleTSUpdateTimeline updates a timeline's mutable fields.
PATCH /api/v1/tenant/{tenant_id}/ts/timelines/{timeline_id}
func (*Server) MarkReady ¶
func (s *Server) MarkReady()
MarkReady sets the server as ready. This is called automatically by Start(), but can be called manually in test setups that use httptest.NewServer instead of Start().
func (*Server) Shutdown ¶
Shutdown gracefully shuts down the HTTP server, allowing in-flight requests to complete within the given context deadline.
func (*Server) TenantRegistry ¶
TenantRegistry returns the server's tenant registry. This is primarily useful for pre-registering tenants in strict mode before starting the server.