json

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 12 Imported by: 2

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

Jump to

Keyboard shortcuts

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