app

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2016 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version - set at buildtime.
	Version = "dev"

	// UniqueID - set at runtime.
	UniqueID = "0"
)

Functions

func RegisterControlRoutes added in v0.11.0

func RegisterControlRoutes(router *mux.Router)

RegisterControlRoutes registers the various control routes with a http mux.

func RegisterReportPostHandler added in v0.11.0

func RegisterReportPostHandler(a Adder, router *mux.Router)

RegisterReportPostHandler registers the handler for report submission

func TopologyHandler added in v0.12.0

func TopologyHandler(c Reporter, preRoutes *mux.Router, postRoutes http.Handler) http.Handler

TopologyHandler registers the various topology routes with a http mux.

The returned http.Handler has to be passed directly to http.ListenAndServe, and cannot be nested inside another gorrilla.mux.

Routes which should be matched before the topology routes should be added to a router and passed in preRoutes. Routes to be matches after topology routes should be added to a router and passed to postRoutes.

func URLMatcher added in v0.5.0

func URLMatcher(pattern string) mux.MatcherFunc

URLMatcher uses request.RequestURI (the raw, unparsed request) to attempt to match pattern. It does this as go's URL.Parse method is broken, and mistakenly unescapes the Path before parsing it. This breaks %2F (encoded forward slashes) in the paths.

Types

type APINode

type APINode struct {
	Node detailed.Node `json:"node"`
}

APINode is returned by the /api/topology/{name}/{id} handler.

type APITopology

type APITopology struct {
	Nodes render.RenderableNodes `json:"nodes"`
}

APITopology is returned by the /api/topology/{name} handler.

type APITopologyDesc

type APITopologyDesc struct {
	Name    string                         `json:"name"`
	Options map[string][]APITopologyOption `json:"options"`

	URL           string            `json:"url"`
	SubTopologies []APITopologyDesc `json:"sub_topologies,omitempty"`
	Stats         topologyStats     `json:"stats,omitempty"`
	// contains filtered or unexported fields
}

APITopologyDesc is returned in a list by the /api/topology handler.

type APITopologyOption added in v0.7.0

type APITopologyOption struct {
	Value   string `json:"value"`
	Display string `json:"display"`
	Default bool   `json:"default,omitempty"`
	// contains filtered or unexported fields
}

APITopologyOption describes a &param=value to a given topology.

type Adder added in v0.10.0

type Adder interface {
	Add(report.Report)
}

Adder is something that can accept reports. It's a convenient interface for parts of the app, and several experimental components.

type Collector added in v0.10.0

type Collector interface {
	Reporter
	Adder
}

A Collector is a Reporter and an Adder

func NewCollector added in v0.10.0

func NewCollector(window time.Duration) Collector

NewCollector returns a collector ready for use.

type PipeRouter added in v0.11.0

type PipeRouter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

PipeRouter connects incoming and outgoing pipes.

func RegisterPipeRoutes added in v0.11.0

func RegisterPipeRoutes(router *mux.Router) *PipeRouter

RegisterPipeRoutes registers the pipe routes

func (*PipeRouter) Stop added in v0.11.0

func (pr *PipeRouter) Stop()

Stop stops the pipeRouter

type Reporter

type Reporter interface {
	Report() report.Report
	WaitOn(chan struct{})
	UnWait(chan struct{})
}

Reporter is something that can produce reports on demand. It's a convenient interface for parts of the app, and several experimental components.

Jump to

Keyboard shortcuts

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