Documentation
¶
Index ¶
- func Wrap(handler http.Handler, opts ...Option) http.Handler
- type Config
- type Option
- func WithDashboardPath(path string) Option
- func WithIgnorePaths(patterns ...string) Option
- func WithMaxRequests(max int) Option
- func WithMemoryStorage() Option
- func WithOTelEndpoint(endpoint string) Option
- func WithOpenTelemetry(enabled bool) Option
- func WithPostgresStorage(connStr string, tableName string) Option
- func WithRedisStorage(connStr string, ttlSeconds int) Option
- func WithRequestBodyLogging(enabled bool) Option
- func WithResponseBodyLogging(enabled bool) Option
- func WithSQLiteStorage(dbPath string, tableName string) Option
- func WithServiceName(name string) Option
- func WithServiceVersion(version string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
MaxRequests int
DashboardPath string
LogRequestBody bool
LogResponseBody bool
IgnorePaths []string
// OpenTelemetry configuration
EnableOpenTelemetry bool
ServiceName string
ServiceVersion string
OTelEndpoint string
// Storage configuration
StorageType store.StorageType
// Connection string for database stores
ConnectionString string
// TableName for SQL database stores
TableName string
// TTL for Redis store in seconds
RedisTTL int
}
func (*Config) ShouldIgnorePath ¶
ShouldIgnorePath checks if a path should be ignored based on the configured patterns ShouldIgnorePath checks if a path should be ignored based on the configured patterns
type Option ¶
type Option func(*Config)
Option is a function that modifies the configuration
func WithDashboardPath ¶
WithDashboardPath sets the path to access the dashboard
func WithIgnorePaths ¶
WithIgnorePaths sets the path patterns to ignore
func WithMaxRequests ¶
WithMaxRequests sets the maximum number of requests to store
func WithMemoryStorage ¶ added in v0.1.4
func WithMemoryStorage() Option
WithMemoryStorage configures the application to use in-memory storage
func WithOTelEndpoint ¶ added in v0.1.3
WithOTelEndpoint sets the OTLP endpoint for exporting telemetry data
func WithOpenTelemetry ¶ added in v0.1.3
WithOpenTelemetry enables or disables OpenTelemetry instrumentation
func WithPostgresStorage ¶ added in v0.1.4
WithPostgresStorage configures the application to use PostgreSQL storage
func WithRedisStorage ¶ added in v0.1.4
WithRedisStorage configures the application to use Redis storage
func WithRequestBodyLogging ¶
WithRequestBodyLogging enables or disables request body logging
func WithResponseBodyLogging ¶
WithResponseBodyLogging enables or disables response body logging
func WithSQLiteStorage ¶ added in v0.1.5
WithSQLiteStorage configures the application to use SQLite storage
func WithServiceName ¶ added in v0.1.3
WithServiceName sets the service name for OpenTelemetry
func WithServiceVersion ¶ added in v0.1.3
WithServiceVersion sets the service version for OpenTelemetry
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
examples/basic
command
|
|
|
examples/multistorage
command
|
|
|
examples/otel
command
|
|
|
internal
|
|
