Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MetricsRecorder ¶
MetricsRecorder is the middleware that records metrics for the request
Types ¶
type Authenticator ¶
type Authenticator struct { }
Authenticator manages the authentication for requests. It is empty here but could be extended to pull in state (for example if you wanted to check user auth against a persistent store then you would keep the connection in here).
func NewAuthenticator ¶
func NewAuthenticator() *Authenticator
NewAuthenticator creates a new authenticator struct that could be used to authenticate requests.
func (Authenticator) Authenticate ¶
func (a Authenticator) Authenticate(next http.Handler) http.Handler
Authenticate authenticates requests for the authenticator
type RequestFingerprint ¶
type RequestFingerprint struct {
// contains filtered or unexported fields
}
RequestFingerprint manages the fingerprint information for a request. This struct is passed in a context via the http.Request `WithContext` function. This means that anything downstream of the fingerpring will have access to the information within the fingerprint simply by calling the `GetRequestFingerprint(r) function.`
func GetRequestFingerprint ¶
func GetRequestFingerprint(r *http.Request) (f *RequestFingerprint, err error)
GetRequestFingerprint gets the fingerprint of the request
func NewRequestFingerprint ¶
func NewRequestFingerprint(r *http.Request) *RequestFingerprint
NewRequestFingerprint creates a new fingerprint for a request
func (*RequestFingerprint) GetID ¶
func (f *RequestFingerprint) GetID() (id string)
GetID gets the id fingerprint of the request
func (*RequestFingerprint) GetSource ¶
func (f *RequestFingerprint) GetSource() (source string)
GetSource gets the source ip for a request
func (*RequestFingerprint) GetUser ¶
func (f *RequestFingerprint) GetUser() (user string)
GetUser gets the user of the request
func (*RequestFingerprint) SetUser ¶
func (f *RequestFingerprint) SetUser(user string)
SetUser sets the user for a request fingerprint