handler

package
v0.0.0-...-ad35ae5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2018 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Overview

Package handler http server handler functions

Package handler http server handler functions

Package handler http server handler functions

Package handler http server handler functions

Package handler http server handler functions

Package handler http server handler functions

Package handler http server handler functions

Package handler http server handler functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(handlers ...Handler) http.HandlerFunc

Append concat a list of Routers into the router routing table returns

http.HandlerFunc - the first http handler function to call

Types

type APIHhandler

type APIHhandler struct {
	Verbose          bool
	Storage          storage.Storage
	Alerts           *alerts.AlertRules
	DefaultTenant    string
	DefaultStartTime string
}

APIHhandler common variables to be used by all APIHhandler functions

version the version of the Hawkular server we are mocking
storage the storage to be used by the APIHhandler functions

func (APIHhandler) DeleteData

func (h APIHhandler) DeleteData(w http.ResponseWriter, r *http.Request, argv map[string]string) error

DeleteData delete a list of metrics raw data

func (APIHhandler) DeleteTags

func (h APIHhandler) DeleteTags(w http.ResponseWriter, r *http.Request, argv map[string]string) error

DeleteTags delete a tag

func (APIHhandler) GetAlerts

func (h APIHhandler) GetAlerts(w http.ResponseWriter, r *http.Request, argv map[string]string) error

GetAlerts return a list of alerts

func (APIHhandler) GetAlertsStatus

func (h APIHhandler) GetAlertsStatus(w http.ResponseWriter, r *http.Request, argv map[string]string) error

GetAlertsStatus return a json alerts status struct

func (APIHhandler) GetData

func (h APIHhandler) GetData(w http.ResponseWriter, r *http.Request, argv map[string]string) error

GetData return a list of metrics raw / stat data

func (APIHhandler) GetExports

func (h APIHhandler) GetExports(w http.ResponseWriter, r *http.Request, argv map[string]string) error

GetExports return a list of metrics if prmetheus export format

func (APIHhandler) GetMetrics

func (h APIHhandler) GetMetrics(w http.ResponseWriter, r *http.Request, argv map[string]string) error

GetMetrics return a list of metrics definitions

func (APIHhandler) GetMetricsHelper

func (h APIHhandler) GetMetricsHelper(w http.ResponseWriter, r *http.Request, argv map[string]string) ([]storage.Item, error)

GetMetricsHelper helper function to return a list of metrics definitions

func (APIHhandler) GetTenants

func (h APIHhandler) GetTenants(w http.ResponseWriter, r *http.Request, argv map[string]string) error

GetTenants return a list of metrics tenants

func (APIHhandler) PostData

func (h APIHhandler) PostData(w http.ResponseWriter, r *http.Request, argv map[string]string) error

PostData send timestamp, value to the storage

func (APIHhandler) PostMQuery

func (h APIHhandler) PostMQuery(w http.ResponseWriter, r *http.Request, argv map[string]string) error

PostMQuery query data from storage + gauges

func (APIHhandler) PostQuery

func (h APIHhandler) PostQuery(w http.ResponseWriter, r *http.Request, argv map[string]string) error

PostQuery query data from storage

func (APIHhandler) PutMultiTags

func (h APIHhandler) PutMultiTags(w http.ResponseWriter, r *http.Request, argv map[string]string) error

PutMultiTags send tags pet dataItem - tag, value pairs to the storage

func (APIHhandler) PutTags

func (h APIHhandler) PutTags(w http.ResponseWriter, r *http.Request, argv map[string]string) error

PutTags send tag, value pairs to the storage

type Authorization

type Authorization struct {
	PublicPathRegex *regexp.Regexp
	Authorization   string
	Verbose         bool
	// contains filtered or unexported fields
}

Authorization middleware that will authorize http requests

func (*Authorization) ServeHTTP

func (a *Authorization) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP http serve func

func (*Authorization) SetNext

func (a *Authorization) SetNext(h http.Handler)

SetNext set next http serve func

type BadRequest

type BadRequest struct {
	Verbose bool
}

BadRequest will be called if no route found

func (BadRequest) ServeHTTP

func (b BadRequest) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP http serve func

func (*BadRequest) SetNext

func (b *BadRequest) SetNext(_h http.Handler)

SetNext set next http serve func

type Handler

type Handler interface {
	SetNext(http.Handler)
	ServeHTTP(http.ResponseWriter, *http.Request)
}

Handler handler type interface

type Headers

type Headers struct {
	Verbose bool
	// contains filtered or unexported fields
}

Headers middleware that will log http requests

func (Headers) ServeHTTP

func (l Headers) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP http serve func

func (*Headers) SetNext

func (l *Headers) SetNext(h http.Handler)

SetNext set next http serve func

type Logger

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

Logger middleware that will log http requests

func (Logger) ServeHTTP

func (l Logger) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP http serve func

func (*Logger) SetNext

func (l *Logger) SetNext(h http.Handler)

SetNext set next http serve func

type Static

type Static struct {
	MediaPath string
	// contains filtered or unexported fields
}

Static handler to serve static file

func (Static) ServeHTTP

func (s Static) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP http serve func

func (*Static) SetNext

func (s *Static) SetNext(h http.Handler)

SetNext set next http serve func

Jump to

Keyboard shortcuts

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