package
0.0.0-20250213232608-c453f8b35c75
Repository: https://github.com/stellar/go.git
Documentation: pkg.go.dev

# Packages

Package httpauthz contains helper functions for parsing the 'Authorization' header in HTTP requests.
Package httptest enhances the stdlib net/http/httptest package by integrating it with gopkg.in/gavv/httpexpect.v1, reducing the boilerplate needed for http tests.
Package mutil contains various functions that are helpful when writing http middleware.

# Functions

EqualFileSystems traverses two http.FileSystem instances and returns true if they are equal.
GetChiRoutePattern returns the chi route pattern from the given request context.
HeadersMiddleware sends headers.
LoggingMiddleware is a middleware that logs requests to the logger.
LoggingMiddlewareWithOptions is a middleware that logs requests to the logger.
NewAPIMux returns a new server mux configured with the common defaults used for a web API in stellar.
NewMux returns a new server mux configured with the common defaults used across all stellar services.
Run starts an http server using the provided config struct.
SetLogger is a middleware that sets a logger on the context.
StripTrailingSlashMiddleware strips trailing slash.
XFFMiddleware is a middleware that replaces http.Request.RemoteAddr with a visitor value based on a given config: - If BehindCloudflare is true CF-Connecting-IP header is used.

# Structs

Config represents the configuration of an http server that can be provided to `Run`.
Options allow the middleware logger to accept additional information.
XFFMiddlewareConfig provides a configuration for XFFMiddleware.

# Interfaces

SimpleHTTPClientInterface helps mocking http.Client in tests.