json

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 17 Imported by: 5 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// WriteJSONURL is the url for the write json handler
	WriteJSONURL = route.Prefix + "/json/write"

	// JSONWriteHTTPMethod is the HTTP method used with this resource.
	JSONWriteHTTPMethod = http.MethodPost
)

Variables

This section is empty.

Functions

func NewWriteJSONHandler

func NewWriteJSONHandler(opts options.HandlerOptions) http.Handler

NewWriteJSONHandler returns a new instance of handler.

Types

type WriteJSONHandler

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

WriteJSONHandler represents a handler for the write json endpoint

func (*WriteJSONHandler) ServeHTTP

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

type WriteQuery

type WriteQuery struct {
	Tags      map[string]string `json:"tags" validate:"nonzero"`
	Timestamp string            `json:"timestamp" validate:"nonzero"`
	Value     float64           `json:"value" validate:"nonzero"`
}

WriteQuery represents the write request from the user NB(braskin): support only writing one datapoint for now TODO: build this out to be a legitimate batched endpoint, change Tags to take a list of tag structs

Jump to

Keyboard shortcuts

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