router

package
v1.0.0-beta.15 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	NamespaceManager   *namespace.Manager
	StreamingConnector streaming.Connector
	IngestHandler      IngestHandler
	Meters             meter.Repository
}

type IngestHandler

type IngestHandler interface {
	ServeHTTP(w http.ResponseWriter, r *http.Request, params api.IngestEventsParams)
}

type QueryMeterResponse

type QueryMeterResponse struct {
	WindowSize *models.WindowSize     `json:"windowSize,omitempty"`
	From       *time.Time             `json:"from,omitempty"`
	To         *time.Time             `json:"to,omitempty"`
	Data       []models.MeterQueryRow `json:"data"`
}

QueryMeterResponse is returned by the QueryMeter endpoint.

func (QueryMeterResponse) Render

Render implements the chi renderer interface.

func (QueryMeterResponse) RenderCSV

func (resp QueryMeterResponse) RenderCSV(w http.ResponseWriter, r *http.Request, groupByKeys []string, meterIDOrSlug string)

RenderCSV renders the response as CSV.

type Router

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

func NewRouter

func NewRouter(config Config) (*Router, error)

func (*Router) CreateMeter

func (a *Router) CreateMeter(w http.ResponseWriter, r *http.Request, params api.CreateMeterParams)

func (*Router) CreateNamespace

func (a *Router) CreateNamespace(w http.ResponseWriter, r *http.Request)

CreateNamespace handles the HTTP request for creating a new namespace.

func (*Router) DeleteMeter

func (a *Router) DeleteMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug string, params api.DeleteMeterParams)

func (*Router) GetMeter

func (a *Router) GetMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug string, params api.GetMeterParams)

func (*Router) IngestEvents

func (a *Router) IngestEvents(w http.ResponseWriter, r *http.Request, params api.IngestEventsParams)

func (*Router) ListEvents

func (a *Router) ListEvents(w http.ResponseWriter, r *http.Request, params api.ListEventsParams)

func (*Router) ListMeterSubjects

func (a *Router) ListMeterSubjects(w http.ResponseWriter, r *http.Request, meterIDOrSlug string, params api.ListMeterSubjectsParams)

ListMeterSubjects lists the subjects of a meter.

func (*Router) ListMeters

func (a *Router) ListMeters(w http.ResponseWriter, r *http.Request, params api.ListMetersParams)

func (*Router) QueryMeter

func (a *Router) QueryMeter(w http.ResponseWriter, r *http.Request, meterIDOrSlug string, params api.QueryMeterParams)

QueryMeter queries the values stored for a meter.

Jump to

Keyboard shortcuts

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