httputil

package
v0.0.0-...-8de5e17 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeInfoHandler

func MakeInfoHandler(c Consumer, started time.Time) http.HandlerFunc

MakeInfoHandler returns an HTTP handler which can be added to an exposed HTTP server mux by Metafora applications to provide operators with basic node introspection.

Types

type Consumer

type Consumer interface {
	Frozen() bool
	Tasks() []metafora.RunningTask
	String() string
}

Consumer contains just the Metafora methods exposed by the HTTP introspection endpoints.

type InfoResponse

type InfoResponse struct {
	Frozen  bool      `json:"frozen"`
	Name    string    `json:"name"`
	Started time.Time `json:"started"`
	Tasks   []Task    `json:"tasks"`
}

InfoResponse is the JSON response marshalled by the MakeInfoHandler.

type Task

type Task struct {
	ID       string        `json:"id"`
	Started  time.Time     `json:"started"`
	Stopped  *time.Time    `json:"stopped,omitempty"`
	State    string        `json:"state,omitempty"`
	Modified *time.Time    `json:"modified,omitempty"`
	Task     metafora.Task `json:"task"`
}

Jump to

Keyboard shortcuts

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