hkp.v1: gopkg.in/hockeypuck/hkp.v1 Index | Files | Directories

package hkp

import "gopkg.in/hockeypuck/hkp.v1"

Index

Package Files

handler.go requests.go writers.go

Constants

const (
    OperationGet    = Operation("get")
    OperationIndex  = Operation("index")
    OperationVIndex = Operation("vindex")
    OperationStats  = Operation("stats")
    OperationHGet   = Operation("hget")
)
const (
    OptionMachineReadable = Option("mr")
    OptionJSON            = Option("json")
    OptionNotModifiable   = Option("nm")
)

type Add Uses

type Add struct {
    Keytext string
    Options OptionSet
}

Add represents a valid /pks/add request content, parameters and options.

func ParseAdd Uses

func ParseAdd(req *http.Request) (*Add, error)

type AddResponse Uses

type AddResponse struct {
    Inserted []string `json:"inserted"`
    Updated  []string `json:"updated"`
    Ignored  []string `json:"ignored"`
}

type HTMLFormat Uses

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

func NewHTMLFormat Uses

func NewHTMLFormat(path string, extra []string) (*HTMLFormat, error)

func (*HTMLFormat) Write Uses

func (f *HTMLFormat) Write(w http.ResponseWriter, l *Lookup, keys []*openpgp.PrimaryKey) error

type Handler Uses

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

func NewHandler Uses

func NewHandler(storage storage.Storage, options ...HandlerOption) (*Handler, error)

func (*Handler) Add Uses

func (h *Handler) Add(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Handler) HashQuery Uses

func (h *Handler) HashQuery(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Handler) Lookup Uses

func (h *Handler) Lookup(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Handler) Register Uses

func (h *Handler) Register(r *httprouter.Router)

type HandlerOption Uses

type HandlerOption func(h *Handler) error

func IndexTemplate Uses

func IndexTemplate(path string, extra ...string) HandlerOption

func StatsFunc Uses

func StatsFunc(f func() (interface{}, error)) HandlerOption

func StatsTemplate Uses

func StatsTemplate(path string, extra ...string) HandlerOption

func VIndexTemplate Uses

func VIndexTemplate(path string, extra ...string) HandlerOption

type HashQuery Uses

type HashQuery struct {
    Digests []string
}

func ParseHashQuery Uses

func ParseHashQuery(req *http.Request) (*HashQuery, error)

type IndexFormat Uses

type IndexFormat interface {
    Write(w http.ResponseWriter, l *Lookup, keys []*openpgp.PrimaryKey) error
}

type JSONFormat Uses

type JSONFormat struct{}

func (*JSONFormat) Write Uses

func (*JSONFormat) Write(w http.ResponseWriter, _ *Lookup, keys []*openpgp.PrimaryKey) error

type Lookup Uses

type Lookup struct {
    Op          Operation
    Search      string
    Options     OptionSet
    Fingerprint bool
    Exact       bool
    Hash        bool
}

Lookup contains all the parameters and options for a /pks/lookup request.

func ParseLookup Uses

func ParseLookup(req *http.Request) (*Lookup, error)

type MRFormat Uses

type MRFormat struct{}

func (*MRFormat) Write Uses

func (*MRFormat) Write(w http.ResponseWriter, l *Lookup, keys []*openpgp.PrimaryKey) error

type Operation Uses

type Operation string

Operation enumerates the supported HKP operations (op parameter) in the request.

func ParseOperation Uses

func ParseOperation(s string) (Operation, bool)

type Option Uses

type Option string

Option defines modifiers available to some HKP requests.

type OptionSet Uses

type OptionSet map[Option]bool

func ParseOptionSet Uses

func ParseOptionSet(s string) OptionSet

type StatsResponse Uses

type StatsResponse struct {
    Info  interface{}
    Stats *sks.Stats
}

Directories

PathSynopsis
jsonhkpPackage jsonhkp defines an arbitrary, Hockeypuck-specific, JSON-friendly document model for representation of OpenPGP key material.
pks
sks
storage
storage/mock

Package hkp imports 20 packages (graph) and is imported by 3 packages. Updated 2016-07-15. Refresh now. Tools for package owners.