hkp

package module
v1.0.0-...-9f5453b Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2018 License: AGPL-3.0 Imports: 20 Imported by: 3

README

Build Status GoDoc

hkp

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Add

type Add struct {
	Keytext string
	Options OptionSet
}

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

func ParseAdd

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

type AddResponse

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

type HTMLFormat

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

func NewHTMLFormat

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

func (*HTMLFormat) Write

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

type Handler

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

func NewHandler

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

func (*Handler) Add

func (*Handler) HashQuery

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

func (*Handler) Lookup

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

func (*Handler) Register

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

type HandlerOption

type HandlerOption func(h *Handler) error

func IndexTemplate

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

func StatsFunc

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

func StatsTemplate

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

func VIndexTemplate

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

type HashQuery

type HashQuery struct {
	Digests []string
}

func ParseHashQuery

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

type IndexFormat

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

type JSONFormat

type JSONFormat struct{}

func (*JSONFormat) Write

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

type Lookup

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

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

type MRFormat

type MRFormat struct{}

func (*MRFormat) Write

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

type Operation

type Operation string

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

func ParseOperation

func ParseOperation(s string) (Operation, bool)

type Option

type Option string

Option defines modifiers available to some HKP requests.

type OptionSet

type OptionSet map[Option]bool

func ParseOptionSet

func ParseOptionSet(s string) OptionSet

type StatsResponse

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

Directories

Path Synopsis
Package jsonhkp defines an arbitrary, Hockeypuck-specific, JSON-friendly document model for representation of OpenPGP key material.
Package jsonhkp defines an arbitrary, Hockeypuck-specific, JSON-friendly document model for representation of OpenPGP key material.

Jump to

Keyboard shortcuts

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