Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestID

func RequestID(ctx context.Context) string

Types

type Chain

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

    A Chain is a middleware chain use for http request processing.

    func NewChain

    func NewChain(middlewares ...Middleware) Chain

      NewChain creates a new Middleware chain. The chain will call the Middleware in the order provided.

      func (Chain) Handler

      func (c Chain) Handler(h http.Handler) http.Handler

        Handler returns an http.Handler for this chain.

        type GenerateIDFunc

        type GenerateIDFunc func() string

        type Middleware

        type Middleware func(http.Handler) http.Handler

        func RequireCert

        func RequireCert() Middleware

          RequireCert is used to ensure that a verified TLS client certificate was used for authentication.

          func WithRequestID

          func WithRequestID(generator GenerateIDFunc) Middleware