-
Notifications
You must be signed in to change notification settings - Fork 20
Update Wrap middleware arguments #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
erancihan
wants to merge
1
commit into
doganarif:main
Choose a base branch
from
erancihan:feat/isolate-options-config
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| package options | ||
|
|
||
| import ( | ||
| "database/sql" | ||
| "path/filepath" | ||
| "strings" | ||
| "time" | ||
|
|
||
| "github.com/doganarif/govisual/internal/profiling" | ||
| "github.com/doganarif/govisual/internal/store" | ||
| ) | ||
|
|
||
| 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 | ||
|
|
||
| // Existing database connection for SQLite | ||
| ExistingDB *sql.DB | ||
|
|
||
| // Performance Profiling configuration | ||
| EnableProfiling bool | ||
|
|
||
| ProfileType profiling.ProfileType | ||
|
|
||
| ProfileThreshold time.Duration | ||
|
|
||
| MaxProfileMetrics int | ||
| } | ||
|
|
||
| // ShouldIgnorePath checks if a path should be ignored based on the configured patterns | ||
| func (c *Config) ShouldIgnorePath(path string) bool { | ||
sourcery-ai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // First check if it's the dashboard path which should always be ignored to prevent recursive logging | ||
| if path == c.DashboardPath || strings.HasPrefix(path, c.DashboardPath+"/") { | ||
| return true | ||
| } | ||
|
|
||
| // Then check against provided ignore patterns | ||
| for _, pattern := range c.IgnorePaths { | ||
| matched, err := filepath.Match(pattern, path) | ||
| if err == nil && matched { | ||
| return true | ||
| } | ||
|
|
||
| // Special handling for path groups with trailing slash | ||
| if len(pattern) > 0 && pattern[len(pattern)-1] == '/' { | ||
| // If pattern ends with /, check if path starts with pattern | ||
| if len(path) >= len(pattern) && path[:len(pattern)] == pattern { | ||
| return true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return false | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.