mirror of
https://github.com/lukaszraczylo/graphql-monitoring-proxy.git
synced 2026-10-22 06:38:13 +00:00
Gofmt the codebase.
This commit is contained in:
Vendored
+3
-3
@@ -17,8 +17,8 @@ const CompressionThreshold = 1024 // 1KB
|
||||
const MaxCacheSize = 10000
|
||||
|
||||
type CacheEntry struct {
|
||||
ExpiresAt time.Time
|
||||
Value []byte
|
||||
ExpiresAt time.Time
|
||||
Value []byte
|
||||
Compressed bool
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ func (c *Cache) CleanExpiredEntries() {
|
||||
// evictOldest removes the oldest n entries from the cache
|
||||
func (c *Cache) evictOldest(n int) {
|
||||
type keyExpiry struct {
|
||||
key string
|
||||
key string
|
||||
expiresAt time.Time
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
cfg *config
|
||||
cfgMutex sync.RWMutex
|
||||
once sync.Once
|
||||
tracer *libpack_tracing.TracingSetup
|
||||
cfg *config
|
||||
cfgMutex sync.RWMutex
|
||||
once sync.Once
|
||||
tracer *libpack_tracing.TracingSetup
|
||||
)
|
||||
|
||||
// getDetailsFromEnv retrieves the value from the environment or returns the default.
|
||||
|
||||
@@ -157,7 +157,7 @@ func extractUserInfo(c *fiber.Ctx) (string, string) {
|
||||
|
||||
// Extract from JWT if available
|
||||
if authorization := c.Get("Authorization"); authorization != "" &&
|
||||
(len(cfg.Client.JWTUserClaimPath) > 0 || len(cfg.Client.JWTRoleClaimPath) > 0) {
|
||||
(len(cfg.Client.JWTUserClaimPath) > 0 || len(cfg.Client.JWTRoleClaimPath) > 0) {
|
||||
extractedUserID, extractedRoleName = extractClaimsFromJWTHeader(authorization)
|
||||
}
|
||||
|
||||
@@ -217,6 +217,7 @@ func handleCaching(c *fiber.Ctx, parsedResult *parseGraphQLQueryResult, userID s
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// proxyAndCacheTheRequest proxies and caches the request if needed.
|
||||
func proxyAndCacheTheRequest(c *fiber.Ctx, queryCacheHash string, cacheTime int, currentEndpoint string) error {
|
||||
if err := proxyTheRequest(c, currentEndpoint); err != nil {
|
||||
|
||||
+2
-2
@@ -68,8 +68,8 @@ func NewTracing(ctx context.Context, endpoint string) (*TracingSetup, error) {
|
||||
semconv.DeploymentEnvironment("production"),
|
||||
attribute.String("application.type", "proxy"),
|
||||
),
|
||||
resource.WithHost(), // Add host information
|
||||
resource.WithOSType(), // Add OS information
|
||||
resource.WithHost(), // Add host information
|
||||
resource.WithOSType(), // Add OS information
|
||||
resource.WithProcessPID(), // Add process information
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user