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
- Variables
- func HandleFunc(pattern string, handler func() handy.Handler)
- func StartStaticHandler()
- type DomainHandler
- func (h *DomainHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *DomainHandler) Get(w http.ResponseWriter, r *http.Request)
- func (h *DomainHandler) Head(w http.ResponseWriter, r *http.Request)
- func (h *DomainHandler) Interceptors() handy.InterceptorChain
- func (h *DomainHandler) Put(w http.ResponseWriter, r *http.Request)
- type DomainVerificationHandler
- func (h *DomainVerificationHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *DomainVerificationHandler) Get(w http.ResponseWriter, r *http.Request)
- func (h *DomainVerificationHandler) Head(w http.ResponseWriter, r *http.Request)
- func (h *DomainVerificationHandler) Interceptors() handy.InterceptorChain
- func (h *DomainVerificationHandler) Put(w http.ResponseWriter, r *http.Request)
- type DomainsHandler
- type ScanHandler
- func (h *ScanHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *ScanHandler) Get(w http.ResponseWriter, r *http.Request)
- func (h *ScanHandler) Head(w http.ResponseWriter, r *http.Request)
- func (h *ScanHandler) Interceptors() handy.InterceptorChain
- func (h *ScanHandler) Put(w http.ResponseWriter, r *http.Request)
- type ScansHandler
- type StaticHandler
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 ¶
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 (h *DomainHandler) Get(w http.ResponseWriter, r *http.Request)
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 ¶
func (h *DomainHandler) Put(w http.ResponseWriter, r *http.Request)
type DomainVerificationHandler ¶
type DomainVerificationHandler struct { handy.DefaultHandler FQDN string `param:"fqdn"` }
func (*DomainVerificationHandler) Delete ¶
func (h *DomainVerificationHandler) Delete(w http.ResponseWriter, r *http.Request)
func (*DomainVerificationHandler) Get ¶
func (h *DomainVerificationHandler) Get(w http.ResponseWriter, r *http.Request)
func (*DomainVerificationHandler) Head ¶
func (h *DomainVerificationHandler) Head(w http.ResponseWriter, r *http.Request)
func (*DomainVerificationHandler) Interceptors ¶
func (h *DomainVerificationHandler) Interceptors() handy.InterceptorChain
func (*DomainVerificationHandler) Put ¶
func (h *DomainVerificationHandler) Put(w http.ResponseWriter, r *http.Request)
type DomainsHandler ¶
type DomainsHandler struct {
handy.DefaultHandler
}
func (*DomainsHandler) Get ¶
func (h *DomainsHandler) Get(w http.ResponseWriter, r *http.Request)
func (*DomainsHandler) Head ¶
func (h *DomainsHandler) Head(w http.ResponseWriter, r *http.Request)
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 (h *ScansHandler) Get(w http.ResponseWriter, r *http.Request)
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 (h *StaticHandler) Get(w http.ResponseWriter, r *http.Request)
func (*StaticHandler) Interceptors ¶
func (h *StaticHandler) Interceptors() handy.InterceptorChain
Click to show internal directories.
Click to hide internal directories.