web

package
v0.0.0-...-5ddfa25 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2018 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

This package collects types that are common to both wfe and wfe2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientAddr

func GetClientAddr(r *http.Request) string

Comma-separated list of HTTP clients involved in making this request, starting with the original requestor and ending with the remote end of our TCP connection (which is typically our own proxy).

func ProblemDetailsForError

func ProblemDetailsForError(err error, msg string) *probs.ProblemDetails

problemDetailsForError turns an error into a ProblemDetails with the special case of returning the same error back if its already a ProblemDetails. If the error is of an type unknown to ProblemDetailsForError, it will return a ServerInternal ProblemDetails.

Types

type RequestEvent

type RequestEvent struct {
	RealIP        string    `json:",omitempty"`
	Endpoint      string    `json:",omitempty"`
	Method        string    `json:",omitempty"`
	Errors        []string  `json:",omitempty"`
	Requester     int64     `json:",omitempty"`
	Contacts      *[]string `json:",omitempty"`
	RequestNonce  string    `json:",omitempty"`
	ResponseNonce string    `json:",omitempty"`
	UserAgent     string    `json:",omitempty"`
	Code          int
	Payload       string                 `json:",omitempty"`
	Extra         map[string]interface{} `json:",omitempty"`
}

func (*RequestEvent) AddError

func (e *RequestEvent) AddError(msg string, args ...interface{})

type TopHandler

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

func NewTopHandler

func NewTopHandler(log blog.Logger, wfe wfeHandler) *TopHandler

func (*TopHandler) ServeHTTP

func (th *TopHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WFEHandlerFunc

type WFEHandlerFunc func(context.Context, *RequestEvent, http.ResponseWriter, *http.Request)

func (WFEHandlerFunc) ServeHTTP

func (f WFEHandlerFunc) ServeHTTP(e *RequestEvent, w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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