server

package
v0.9.7-patched74 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

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) Handler

func (s *Server) Handler() http.Handler

Handler returns the HTTP handler (useful for testing)

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

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the HTTP server, allowing in-flight requests to complete within the given context deadline.

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server

func (*Server) Stop

func (s *Server) Stop()

Stop stops the server and cleans up resources

func (*Server) TenantRegistry

func (s *Server) TenantRegistry() *tenant.Registry

TenantRegistry returns the server's tenant registry. This is primarily useful for pre-registering tenants in strict mode before starting the server.

Jump to

Keyboard shortcuts

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