Documentation
¶
Overview ¶
Package hkp implements the OpenPGP HTTP Keyserver Protocol, as described in the Internet-Draft, http://ietfreport.isoc.org/idref/draft-shaw-openpgp-hkp/.
hkp provides a few extensions to the protocol, such as SKS hashquery, server statistics and JSON-formatted search results.
Index ¶
- Variables
- func ErrorInvalidMethod(method string) error
- func ErrorMissingParam(param string) error
- func ErrorUnknownOperation(op string) error
- type Add
- type HashQuery
- type Lookup
- type Operation
- type Option
- type Request
- type RequestChan
- type Response
- type ResponseChan
- type Router
- type Service
- type Settings
Constants ¶
This section is empty.
Variables ¶
AddFormTemplate is used to render the form to add a key.
AddResultTemplate displays the fingerprints of updated keys.
var BaseTemplateSrcs = []string{
headTmplSrc, headerTmplSrc, footerTmplSrc,
layoutTmplSrc}
baseTmplSrcs contains common templates that need to be defined for all Hockeypuck HKP templates.
PksIndexTemplate is used to render the op=index and op=vindex responses when not in machine readable mode.
SearchFormTemplate is used to render the default search form at '/'
StatsTemplate renders the op=stats page
Functions ¶
func ErrorInvalidMethod ¶
ErrorMissingParam constructs an informative error when an invalid HTTP method was requested for the given HKP endpoint.
func ErrorMissingParam ¶
ErrorMissingParam constructs an informative error when a required parameter was missing from a request.
Types ¶
type Add ¶
type Add struct { *http.Request Keytext string Option Option // contains filtered or unexported fields }
An HKP "add" request.
func (*Add) Response ¶
func (a *Add) Response() ResponseChan
Get the response channel for sending a response to an add request.
type HashQuery ¶
func (*HashQuery) Response ¶
func (hq *HashQuery) Response() ResponseChan
type Lookup ¶
type Lookup struct { *http.Request Op Operation Search string Option Option Fingerprint bool Exact bool Hash bool // contains filtered or unexported fields }
An HKP "lookup" request.
func (*Lookup) Response ¶
func (l *Lookup) Response() ResponseChan
Get the response channel that a worker processing a lookup request will use to send the response back to the web server.
type Operation ¶
type Operation int
Operation enumerates the supported HKP operations (op parameter) in the request.
type Request ¶
type Request interface { // Response returns a channel through which to send the response. Response() ResponseChan // Parse interprets the URL and POST parameters according to the HKP draft specification. Parse() error }
Request defines an interface for all HKP web requests.
type Response ¶
type Response interface { Error() error WriteTo(http.ResponseWriter) error }
Worker responses.
type ResponseChan ¶
type ResponseChan chan Response
Response channel to which the workers send their results.
type Service ¶
type Service struct {
Requests RequestChan
}