web

package
v0.0.0-...-5da7e01 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DayTime is one day period.
	DayTime = time.Duration(24*60*60) * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler serves various HTTP endpoints of the Diamond server

func New

func New(o *Option) *Handler

New initializes a new web Handler.

func (*Handler) Run

func (h *Handler) Run()

Run serves the HTTP endpoints.

func (*Handler) Shutdown

func (h *Handler) Shutdown(sig os.Signal) error

Shutdown shoudowns the HTTP server.

type Option

type Option struct {
	Port  string
	Store storage.ReadWriter
}

Options for the web Handler.

type WriteRequest

type WriteRequest struct {
	Metric *model.Metric `json:"metric"`
}

WriteRequest reprensents a request of /datapoints.

Jump to

Keyboard shortcuts

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