Skip to content

v1.29.0

Latest
Compare
Choose a tag to compare
@Umang01-hash Umang01-hash released this 24 Dec 13:12
· 3 commits to development since this release
5bc6ec2

Release v1.29.0


✨ Features:

  1. Custom Metadata in Responses
    Users can now include metadata in API responses using the response.Response struct. This allows for clean, structured responses while providing additional contextual information.
    • Response Structure:
      • With Metadata:
        {
            "data": {},
            "metadata": {}
        }
      • Without Metadata:
        {
            "data": {}
        }
    • Example Usage:
      func HelloHandler(c *gofr.Context) (interface{}, error) {
          headers := map[string]string{
              "X-Custom-Header": "CustomValue",
          }
      
          metaData := map[string]any{
              "environment": "staging",
              "timestamp":   time.Now(),
          }
      
          return response.Response{
              Data:     map[string]string{"message": "Hello, World!"},
              Metadata: metaData,
              Headers:  headers,
          }, nil
      }

  1. Support for Redis Database Selection:
  • Introduces a new config REDIS_DB to specify the Redis database index to be used.
  • Example usage:
    os.Setenv("REDIS_DB", "1")

🛠️ Fixes:

  1. Disconnected Spans Exported for Remote-log-url:
  • Resolves an issue where disconnected spans were created for each fetch request of the remote log.
  • Ensures that all traces exported for a single HTTP request have spans in hierarchy.
  1. Hardcoded Ports Fix:
  • Addresses the issue of hardcoded ports within the codebase.
  • Now allows for dynamic port configuration, improving flexibility and deployment scenarios.
  1. Lowercase Default Paths for CRUD Helpers:
  • Changes the default paths for CRUD helpers to be in lowercase.
  • Helps avoid confusion caused by case sensitivity on certain servers.