Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: gofr-dev/gofr

v1.50.1

14 Dec 13:55
8788c2a

Choose a tag to compare

Release v1.50.1

🚀 Enhancements

🔹 TLS / SSL Support for Database Connections

GoFr now supports secure TLS/SSL connections for relational databases(MySQL / MariaDB/PostgreSQL), improving security and compliance for production deployments.

  • New configuration DB_SSL_MODE with supported modes:

    • disable, preferred, require, skip-verify, verify-ca, verify-full
  • New environment variables for TLS configuration:

    • DB_TLS_CA_CERT

    • DB_TLS_CLIENT_CERT

    • DB_TLS_CLIENT_KEY

  • verify-ca and verify-full modes enforce CA certificate validation

  • Mutual TLS (mTLS) supported via client certificate & key

  • Refer Documentation : Tracing In GoFr for more info.


🔹 Custom Authentication Headers for Tracing Exporters

GoFr now allows configuring custom authentication headers for OpenTelemetry exporters, enabling better compatibility with hosted observability platforms.

Key Highlights:

  • New configuration: TRACER_HEADERS

    • Accepts comma-separated key=value pairs

    • Example: X-Api-Key=secret,Authorization=Bearer token

  • TRACER_HEADERS takes priority over the existing TRACER_AUTH_KEY

  • Refer Documentation : Connecting MySQL for more info.

🛠️ Fixes

🔹 Mock HTTP Services Deduplication in Tests

Fixed an issue where registering multiple mock HTTP services could result in deduplication, causing missing mocks and lost expectations during tests.

Fix Details:

  • Each service registered via WithMockHTTPService(...) now receives a distinct mock instance

  • Expectations must be set per service using: mocks.HTTPServices["serviceName"]

  • Refer Documentation : Testing in GoFr for more info.

v1.50.0

06 Dec 07:16
ce2a806

Choose a tag to compare

Release v1.50.0

🚀Features

🔹 Azure File Storage Support — New File-Store Provider

GoFr now introduces native Azure File Storage integration through a new provider at
gofr.dev/pkg/gofr/datasource/file/azure.

Key Highlights:

  • Supports configuration via AccountName, AccountKey, and ShareName (optional: Endpoint)
  • Automatic connection retry loop with connection-status logging
  • Native directory supportChdir, ReadDir, and Stat behave like a real filesystem
  • Automatic parent-directory creation for nested file paths
  • Built-in content-type detection based on extension (json, txt, csv, xml, html, pdf, etc.)
  • One file share per file-store instance (explicitly documented)
  • Complete documentation & examples added under Official File Handling in GoFr Documentation

Example

// Create Azure File Storage filesystem
fs, err := azure.New(&azure.Config{
    AccountName: "mystorageaccount",
    AccountKey:  "myaccountkey",
    ShareName:   "myshare",
    // Endpoint is optional, defaults to https://{AccountName}.file.core.windows.net
    // Endpoint: "https://custom-endpoint.file.core.windows.net",
})

if err != nil {
    app.Logger().Fatalf("Failed to initialize Azure File Storage: %v", err)
}

app.AddFileStore(fs)

app.Run()

🔹 CLI Improvements

  • More helpful ErrCommandNotFound message showing the invalid command entered
  • Better help formatting with aligned command–description columns
  • Enhanced behavior for no-command scenarios: prints help + clearer messaging if added.

Bug Fixes

  • Basic Auth Header Normalization
    Authorization header now correctly uses "Basic " instead of "basic " adhering to RFC standard for Basic Authorization Headers.

v1.49.0

28 Nov 16:14
6a2a683

Choose a tag to compare

Release v1.49.0

🚀 New Features

🔹 DB Resolver for MySQL Read/Write Splitting

GoFr introduces a powerful, production-ready DBResolver module that enables automatic read/write splitting between a primary database and multiple replicas.

Key Highlights:

  • Automatic routing based on HTTP methods:

    • Writes (POST, PUT, PATCH, DELETE) → Primary
    • Reads (GET, HEAD, OPTIONS) → Replicas
  • Route-based overrides using PrimaryRoutes for strongly consistent paths

  • Pluggable read-balancing strategies:

    • Round-robin
    • Random
  • Built-in circuit breaker for tracking replica failures & recovery

  • Full integration through dbresolver.InitDBResolver()

  • Unlocks horizontal scaling for read-heavy services

  • Significantly reduces read latency

  • Ensures high resilience with automatic failover to primary when replicas are down

Additional Details:

Installation

go get gofr.dev/pkg/gofr/datasource/dbresolver@latest

Initializing DBResolver

import (
    "gofr.dev/pkg/gofr"
    "gofr.dev/pkg/gofr/datasource/dbresolver"
)

func main() {
    a := gofr.New()

    err := dbresolver.InitDBResolver(a, &dbresolver.Config{
        Strategy:     dbresolver.StrategyRoundRobin,
        ReadFallback: true,     // fallback to primary if all replicas fail
        MaxFailures:  3,        // mark replica down after 3 failures
        TimeoutSec:   30,       // cooldown before retrying
        PrimaryRoutes: []string{
            "/admin",
            "/api/payments/*",
        },
        Replicas: []dbresolver.ReplicaCredential{
            {Host: "localhost:3307", User: "replica_user1", Password: "pass1"},
            {Host: "replica2.example.com:3308", User: "replica_user2", Password: "pass2"},
            {Host: "replica3.example.com:3309", User: "replica_user3", Password: "pass3"},
        },
    })

    if err != nil {
        a.Logger().Errorf("failed to initialize db resolver: %v", err)
    }

    a.Run()
}

Read Endpoint (Auto → Replica)

a.GET("/customers", func(c *gofr.Context) (any, error) {
    var out []Customer
    c.SQL.Select(c, &out, "SELECT id, name FROM customers")
    return out, nil
})

Write Endpoint (Auto → Primary)

a.POST("/customers", func(c *gofr.Context) (any, error) {
    var cust Customer
    c.Bind(&cust)

    _, err := c.SQL.Exec("INSERT INTO customers (name) VALUES (?)", cust.Name)
    return cust, err
})

Forced Primary Route

a.GET("/admin/customers", func(c *gofr.Context) (any, error) {
    var out []Customer
    c.SQL.Select(c, &out, "SELECT id, name FROM customers")
    return out, nil
})

🔹 XML Responses (response.XML)

GoFr now supports raw XML responses without JSON encoding by using response.XML.

Key Highlights:

  • Writes raw XML bytes directly to the client
  • Default Content-Type = application/xml
  • Perfect for legacy and enterprise XML-based systems

Example:

app.GET("/legacy/xml", func(ctx *gofr.Context) (any, error) {
    content := []byte(`<Response status="ok"><Message>Hello</Message></Response>`)
    return response.XML{Content: content}, nil
})

XML Output

<Response status="ok"><Message>Hello</Message></Response>

📦 Improvements

🔹 Responder Improvements

  • Special response types (Raw, File, Template, XML, Redirect) now follow a unified handling flow
  • Avoids incorrect 206 Partial Content responses
  • Ensures default JSON Content-Type

🔹 DBResolver Pooling Controls

Replica pools now scale relative to primary pools. Defaults:

  • Primary: DB_MAX_IDLE_CONNECTION=2 → Replicas default to 8
  • Primary: DB_MAX_OPEN_CONNECTION=20 → Replicas default to 40

Optional overrides:

DB_REPLICA_MAX_IDLE_CAP=100
DB_REPLICA_MIN_IDLE=5
DB_REPLICA_DEFAULT_IDLE=15
DB_REPLICA_MAX_OPEN_CAP=500
DB_REPLICA_MIN_OPEN=20
DB_REPLICA_DEFAULT_OPEN=150

🐛 Bug Fixes & Small Changes

🔹 Authentication Timing Attack Protection

  • API Key and Basic Auth now use consistent time comparisons

Refer : GoFr Official Documentation
https://gofr.dev/docs

v1.48.0

21 Nov 17:36
3c8f510

Choose a tag to compare

Release v1.48.0

🚀 New Features

🔹 Unified Token-Bucket Rate Limiter for HTTP Clients

GoFr introduces a brand-new, pluggable rate limiter that works across all HTTP client calls.

Key Highlights:

  • Supports in-memory and Redis-backed stores
  • Simple drop-in integration via RateLimiterConfig or AddOption
  • Integer-only token bucket with burst support
  • Background cleanup for local buckets
  • Customizable request grouping using KeyFunc

Why this matters:

  • Ensures consistent throttling across all downstream HTTP services
  • Distributed apps can now safely rate-limit using Redis

Additional Details :

  • Default limit: 60 req/min, burst 10
  • Returns RateLimitError (429) with RetryAfter for easy handling.

📦 Improvements

🔹 HTTP Client Enhancements with Rate Limiting

  • Rate limiter now acts as an HTTP wrapper, intercepting all Get/Post/Put/Delete calls (including header variants)

  • Service key normalization improved via default keying (scheme://host)

  • Cleaner validation through RateLimiterConfig.Validate() with automatic sane defaults

🔹 SQL Operation Normalization

  • SQL operation detection now always returns UPPERCASE keywords. Improves reliability for middleware and query inspection logic.

🔹 OAuth Token URL Validation Cleanup

  • Switched to shared scheme constants (http / https). Reduces duplicated literals and improves code clarity

🐛 Bug Fixes & Small Changes

🔹 Consistent SQL Operation Detection

  • getOperationType() now normalizes to uppercase, preventing case-sensitivity issues across modules

🔹 Documentation Updates

  • HTTP communication guide adds all details to add rate-limiter in your registered HTTP Services. Added examples for:
    • In-memory usage
    • Redis-backed multi-instance usage
    • Custom keying functions
  • Added Documentation to setup gRPC Streaming Services/Clients using GoFr.

Refer : GoFr Official Documentation

v1.47.1

18 Nov 11:46
1af7ad2

Choose a tag to compare

Release v1.47.1

📊 Enhancements

🔹 Unified Datasource Histogram Buckets

GoFr now uses a shared getDefaultDatasourceBuckets() across SQL, Redis, and other datasources.
Benefits:

  • Standardized buckets from 0.05ms → 30s
  • Consistent observability across datasources
  • Improved monitoring fidelity in Prometheus/Grafana
  • Easier cross-datasource latency comparison

🔹 ArangoDB v2.1.6 Compatibility & API Upgrade

Updated GoFr’s ArangoDB datasource to align with the latest github.com/arangodb/go-driver/v2 v2.1.6 driver. This upgrade ensures smooth integration with modern ArangoDB clusters and removes legacy API inconsistencies.

Key Highlights:

  • Migrated collection creation to CreateCollectionV2 / CreateCollectionWithOptionsV2
  • Ensures correct handling of edge and document collection types

🛠️ Bug Fixes

ArangoDB Database Creation – No More False Failures

Previously, calling CreateDatabase() on an existing DB caused unnecessary user-visible errors.
Fix Summary:

  • Added an existence check before creating databases
  • Prevents duplicate-create errors
  • Ensures smooth provisioning flows during app startup or migrations

ArangoDB Collection Type Handling Corrected

Edge collections were previously misconfigured due to missing or incorrect Type assignment.
Fix Summary -

  • Explicit Type handling added for edge vs document collections
  • Ensures correct metadata and relationship behavior
  • Updated tests to validate collection-type correctness

v1.47.0

07 Nov 16:56

Choose a tag to compare

Release v1.47.0

✨ Features

🔹 GCS File System Integration

Introduced Google Cloud Storage (GCS) File System as a new implementation of the GoFr FileSystem interface. This enables seamless integration with GCS while maintaining consistent behavior across existing backends like S3, FTP, and SFTP.

Supported Methods:

type FileSystem interface {
    Create(name string) (File, error)
    Mkdir(name string, perm os.FileMode) error
    MkdirAll(path string, perm os.FileMode) error
    Open(name string) (File, error)
    OpenFile(name string, flag int, perm os.FileMode) (File, error)
    Remove(name string) error
    RemoveAll(path string) error
    Rename(oldname string, newname string) error
    ReadDir(dir string) ([]FileInfo, error)
    Stat(name string) (FileInfo, error)
    ChDir(dirname string) error
    Getwd() (string, error)
}
  • Consistent and unified interface for GCS, S3, FTP, and SFTP file operations.
  • Plug-and-play compatibility with GoFr’s file abstraction layer.
  • Production-ready with proper error wrapping, retries, and structured logging.
  • Simplifies backend switching without changing application logic.

For detailed usage, visit 👉 GoFr Docs — GCS File System


🛠️ Bug Fixes

Remote Logger — Improper JSON Log Formatting

Previously, ANSI color codes and non-ASCII characters appeared in JSON logs, breaking downstream log parsers.

Example of affected log output:

{"level":"DEBUG","time":"2025-09-17T17:54:30.625115633Z","message":"\u001b[38;5;8m5460fd91feac021fd633b5989abdeb26 \u001b[38;5;34m200   \u001b[0m     5855\u001b[38;5;8mµs\u001b[0m GET https://myurl","gofrVersion":"v1.45.0"}

Fix Summary:

  • Removed ANSI color codes and non-ASCII characters from JSON logs.
  • Preserved terminal log colors for local debugging.
  • Ensured all remote JSON logs are now ASCII-safe and parseable by log processors (ELK, Loki, Cloud Logging, etc.).

v1.46.3

17 Oct 14:17
7338d51

Choose a tag to compare

Release v1.46.3

Enhancements

Custom Content-Type Support:

GoFr now allows respective custom content types in HTTP responses and only sets it as JSON when not explicitly present. This enhancement provides developers with greater flexibility in controlling response formats, enabling support for various content types like XML, plain text, or custom formats while maintaining JSON as the sensible default.

Fixes

  • Fixed Remote Log Level Fatal Exit Issue: Resolved a critical bug where changing to fatal level at remote log level was causing the application to exit unexpectedly. This fix ensures that remote logging operations no longer trigger unintended application termination, improving stability and reliability in production environments.

v1.46.2

10 Oct 14:25
2731dd6

Choose a tag to compare

Release v1.46.2

GoFr core package now has 81% test coverage! 🎉
This milestone boosts stability, reliability, and makes contributions safer and easier.

  • Faster CI and more maintainable code

  • 🔜 Upcoming: CLI to make your life easier.

GoFr — Opinionated, Performant, Observable https://gofr.dev

v1.46.1

07 Oct 06:25
4c31ca8

Choose a tag to compare

Release v1.46.1

🚀 Enhanced Telemetry Service

We’ve enhanced GoFr’s telemetry to provide better insights into framework usage and runtime behavior. This improvement enables more accurate tracking of key runtime data to help us optimize performance and stability in future releases.

Telemetry is enabled by default and can be disabled anytime by setting:

export GOFR_TELEMETRY=false

v1.46.0

26 Sep 17:10
6a69c03

Choose a tag to compare

Release v1.46.0

✨ Features

🔹 OracleDB Migration Support

  • Added OracleDB migrations with transaction support.
  • Enables safe schema evolution with begin/commit/rollback semantics for Oracle-specific migrations.

🛠️ Bug Fixes

  • Custom Metrics Naming with OpenTelemetry
    Previously, all custom metrics were forced to include a _total suffix, causing incorrect or duplicate metric names due to internal upgradation of OTEL Package. Now, Metrics can be defined without the mandatory suffix and behave as originally intended.

  • EventHub Subscription Fix
    Previously, EventHub subscribers were unable to consume events published in the system. Now, Subscribers can successfully receive and process published events.

✨ Developer Experience

  • Docker Setup for HTTP Server Example
    Improved the Docker setup for the demo http-server. You can now explore and run it easily at:
    👉 gofr/examples/http-server