handler

package
v0.0.0-...-73d3301 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2016 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package handler store the web client handlers of specific URI

Package handler store the web client handlers of specific URI

Package handler store the web client handlers of specific URI

Package handler store the web client handlers of specific URI

Package handler store the web client handlers of specific URI

Package handler store the web client handlers of specific URI

Package handler store the web client handlers of specific URI

Package handler store the web client handlers of specific URI

Index

Constants

View Source
const (
	ClientTimeout = 5
)

Variables

View Source
var (
	// To send the requests to a REST server we must have at least one address defined in
	// the configuration file
	ErrNoRESTAddresses = errors.New("Don't known the address of the REST server")

	// The user should configure a secret to sign the requests sent to the REST server.
	// Otherwise this error will be thrown on every request sent attempt
	ErrNoSecretFound = errors.New("No secret found to sign the REST request")
)

List of errors that can occur while using the functions from this file. Low level errors can also be thrown

View Source
var (
	Routes map[string]func() handy.Handler
)

Routes is responsable for storing the link beteween an URI and a handler. It uses a library to match the URI because it's faster and allows more complex URI matchs, like /domain/<something>/verification

Functions

func HandleFunc

func HandleFunc(pattern string, handler func() handy.Handler)

Function created only to register the handlers more easily

func StartStaticHandler

func StartStaticHandler()

Types

type DomainHandler

type DomainHandler struct {
	handy.DefaultHandler        // Inject the HTTP methods that this resource does not implement
	FQDN                 string `param:"fqdn"` // FQDN defined in the URI
}

DomainHandler is responsable for keeping the state of a /domain/{fqdn} resource

func (*DomainHandler) Delete

func (h *DomainHandler) Delete(w http.ResponseWriter, r *http.Request)

func (*DomainHandler) Get

func (*DomainHandler) Head

func (h *DomainHandler) Head(w http.ResponseWriter, r *http.Request)

func (*DomainHandler) Interceptors

func (h *DomainHandler) Interceptors() handy.InterceptorChain

func (*DomainHandler) Put

type DomainVerificationHandler

type DomainVerificationHandler struct {
	handy.DefaultHandler
	FQDN string `param:"fqdn"`
}

func (*DomainVerificationHandler) Delete

func (*DomainVerificationHandler) Get

func (*DomainVerificationHandler) Head

func (*DomainVerificationHandler) Interceptors

func (*DomainVerificationHandler) Put

type DomainsHandler

type DomainsHandler struct {
	handy.DefaultHandler
}

func (*DomainsHandler) Get

func (*DomainsHandler) Head

func (*DomainsHandler) Interceptors

func (h *DomainsHandler) Interceptors() handy.InterceptorChain

type ScanHandler

type ScanHandler struct {
	handy.DefaultHandler        // Inject the HTTP methods that this resource does not implement
	StartedAt            string `param:"started-at"` // Scan start date in the URI
}

ScanHandler is responsable for keeping the state of a /scan/{started-at} resource

func (*ScanHandler) Delete

func (h *ScanHandler) Delete(w http.ResponseWriter, r *http.Request)

func (*ScanHandler) Get

func (h *ScanHandler) Get(w http.ResponseWriter, r *http.Request)

func (*ScanHandler) Head

func (h *ScanHandler) Head(w http.ResponseWriter, r *http.Request)

func (*ScanHandler) Interceptors

func (h *ScanHandler) Interceptors() handy.InterceptorChain

func (*ScanHandler) Put

func (h *ScanHandler) Put(w http.ResponseWriter, r *http.Request)

type ScansHandler

type ScansHandler struct {
	handy.DefaultHandler
}

func (*ScansHandler) Get

func (*ScansHandler) Head

func (h *ScansHandler) Head(w http.ResponseWriter, r *http.Request)

func (*ScansHandler) Interceptors

func (h *ScansHandler) Interceptors() handy.InterceptorChain

type StaticHandler

type StaticHandler struct {
	handy.DefaultHandler
}

func (*StaticHandler) Get

func (*StaticHandler) Interceptors

func (h *StaticHandler) Interceptors() handy.InterceptorChain

Jump to

Keyboard shortcuts

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