pipeline

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateDates added in v0.3.0

func ValidateDates(start, end string) (time.Time, time.Time, error)

ValidateDates checks that the start and end dates are valid and returns them as time.Time.

Types

type Exporter

type Exporter interface {
	Export(context.Context, config.Config, *template.Template, int) error
}

Exporter is a configurable data exporter.

type Handler

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

Handler is the handler for /v0/pipeline.

func NewHandler

func NewHandler(bqClient bqiface.Client, exporter Exporter,
	config map[string]config.Config) *Handler

NewHandler returns a new Handler.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles requests to the /pipeline endpoint. This endpoint runs the entire statistics generation pipeline for the provided year, i.e. every configured histogram table is updated and every configured exporting task is run.

The querystring parameters are:

  • year (mandatory): the year to generate statistics for.
  • step: specify which step of the pipeline to run (histograms or exports). A value of "all" runs all the steps.

This endpoint accepts only POST requests.

type HistogramTable

type HistogramTable interface {
	UpdateHistogram(context.Context, time.Time, time.Time) error
}

HistogramTable is an updatable histogram table.

Jump to

Keyboard shortcuts

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