json

package
v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

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

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

Variables

This section is empty.

Functions

func NewWriteJSONHandler

func NewWriteJSONHandler(
	store storage.Storage,
	instrumentOpts instrument.Options,
) 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