Skip to content

Releases: gofr-dev/gofr

v1.18.0

26 Aug 07:49
6ae3322
Compare
Choose a tag to compare

Release v1.18.0

✨ Features

  • SQL Tags in AddRESTHandlers
    The AddRESTHandlers function now supports the following SQL tags for enhanced data integrity and database handling:

    • auto_increment:
      When this tag is applied to a struct field, any provided ID value will be ignored. Instead, the ID returned by the database after insertion will be used.
    • not_null:
      This tag enforces a non-null constraint at the service level, ensuring that no nil value can be sent for the specified field.
      Incase nil value is sent, error will be returned.

    Example:

    type user struct {
        ID 		int 	`json:"id" 	sql:"auto_increment"`
        Name 	string 	`json:"name" 	sql:"not_null"`
        Age 	int 	`json:"age"`
        IsEmployed 	bool 	`json:"isEmployed"`
    }
  • Added support for directory operations in FileSystem
    Supported functionalities are:
    ChDir(dirname string) error - ChDir changes the current directory.
    Getwd() (string, error) - Getwd returns the path of the current directory.
    ReadDir(dir string) ([]FileInfo, error) - ReadDir returns a list of files/directories present in the directory.
    Stat(name string) (FileInfo, error) - Stat returns the file/directory information in the directory.

🛠 Enhancements

  • Error logs for invalid configs
    Added validations for REQUEST_TIMEOUT and REMOTE_LOG_FETCH_INTERVAL configs and log error if invalid.

  • Error logs for internal server errors
    Previously, if any occurred then there was a log with just status code and correlationID.
    Hence, added an error log with correlationID and error message.
    image

  • FileSystem mock methods for testing purpose
    To help test the FileSystem methods, mocks have now been added to mock container struct which can be generated from NewMockContainer method.

🐞 Fixes

  • Resolved application status in case of migration failure
    If any occurs while running the migrations, the application will now gracefully shutdown.

  • Resolved response for error case
    For an error case, where the response consists of error message only and has no data to return, then also the data field was present in output as null.
    This has been removed now, so only error struct will be returned with respective status code.

v1.17.0

12 Aug 09:23
f78d8c7
Compare
Choose a tag to compare

Release v1.17.0

✨ Features

  • Added support for FTP as an external datasource
    FTP can be added using the method on gofrApp AddFTP(fs file.FileSystemProvider)
    Supported functionalities are:
    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, newName string) error

  • Cassandra now supports Batching
    Added Batch functionality with newly introduced methods:
    NewBatch(batchType int) error
    BatchQuery(stmt string, values ...interface{})
    ExecuteBatch() error

  • Automated injection of gofr.Context in the gRPC server during registering of the gRPC service
    gRPC can now inject gofr container to the Server struct, to access logger, datasources, and other functionalities provided by gofr.
    Refer to example for detailed info.

🛠 Enhancements

  • Messages can now be written to WebSocket without returning
    Added method on gofrContext WriteMessageToSocket(data any) error to write a message.

🐞 Fixes

  • Resolved panic for EnableBasicAuth
    If an odd no. of arguments (user, password) were passed to the EnableBasicAuth method, the app panicked. Fixed this issue, user and password can be passed in the method as comma-separated pairs like:
    EnableBasicAuth(user1, pass1, user2, pass2)

  • Resolved authentication for EnableBasicAuth
    Even if the credentials were correct, the app was returning the 401 status Unauthorised instead of the expected 200.

  • Fixed unstructured log in Mongo
    Debug query logs were not properly formatted for Mongo, fixed the formatting.
    The message field in logs was string type, updated it to object

v1.16.1

06 Aug 15:17
cb21d5b
Compare
Choose a tag to compare

Release v1.16.1

🐞 Fixes

  • Resolved DB migrations panic in logging
    App was panicking while logging with migrations datasource, as the logger was nil. Now, populated the logger, hence fixing the panic.
  • Removed unexpected error log for tracing when it was not enabled from configs
    {"level":"ERROR","time":"2024-08-06T17:47:56.714963+05:30","message":"unsupported TRACE_EXPORTER: ","gofrVersion":"v1.16.0"}
    The above log was printed when tracing configs (TRACE_EXPORTER, TRACER_URL) weren't provided, and since tracing is optional feature, removed error log if configs aren't given.

v1.16.0

05 Aug 07:01
a51f573
Compare
Choose a tag to compare

Release v1.16.0

✨ Features

  • Application will now gracefully shutdown to prevent data loss during application termination
    All the processes (go-routines) will be awaited to finish before shutting down. Currently, the timeout for shutdown is 30 seconds. Will be making it configurable in upcoming release.

  • Enhanced query parameter handling to support multiple values
    Previously, only a single value was supported for query params with Param(key string) string method. Now, added another method Params(key string) []string which returns array of values passed for given query param.
    Example:

    If URL is 
     - http://order-service/orders?id=123,234
     - http://order-service/orders?id=123&id=234
     
    Then ctx.Params("id") will return ["123", "234"]
    
  • Enhanced security with SSL support for PostgreSQL connections
    Default certificates can now be used as SSL, by configuring DB_SSL_MODE as require.
    Currently this is only supported with PostgreSQL. Custom certificates and other DBs will be supported in future releases.

🛠 Enhancements

  • Improved logging for tracer configs validation
    Tracing is only enabled when both TRACE_EXPORTER and TRACER_URL are provided, so added error logs if any one of them is provided and the other is missing.

    Screenshot 2024-08-05 at 12 24 53 PM Screenshot 2024-08-05 at 12 27 58 PM
  • Improved tracing with OpenTelemetry protocol integration
    Tracing can now be configured as otel protocol by configuring TRACE_EXPORTER as otlp, and providing TRACER_URL.

🐞 Fixes

  • Resolved panic caused by passing non-pointer objects in AddRESTHandlers method
    App was panicking while initialising if the argument is passed by value to AddRESTHandlers method. Since, the method only accepts arguments passed by reference, added validations and error log instead of panic.

v1.15.0

22 Jul 09:09
e76a4ac
Compare
Choose a tag to compare

Release v1.15.0

✨ Features

  • Add support for BadgerDB as key value store. (#835)

🛠 Enhancements

  • Fail app start in case of error in config file. (#854)
  • Add validations for tracer configs and log errors. (#859)

Changelog: v1.14.1...v1.15.0

v1.14.1

12 Jul 12:21
3637485
Compare
Choose a tag to compare

Release v1.14.1

🐞 Fixes

  • Fix fatal log methods (#842)

Changelog: v1.14.0...v1.14.1

v1.14.0

12 Jul 10:47
7312539
Compare
Choose a tag to compare

This version contains breaking changes, please use v1.14.1

Release v1.14.0

✨ Features

  • Add support for auth header for tracer exporter (#828)
    Authorization header can be passed for tracer using TRACER_AUTH_KEY config

  • Add support for custom tracer URL (#834)
    Traces can now be posted to custom URL provided in TRACER_URL config

NOTE: TRACER_HOST and TRACER_PORT are now deprecated, use TRACER_URL instead.

Changelog: v1.13.0...v1.14.0

v1.13.0

08 Jul 10:18
c632241
Compare
Choose a tag to compare

✨ Features

  • Add support for profilling endpoints. (#774)
  • Add support for MQTT_KEEP_ALIVE. (#771)
  • Support transactions in MongoDB driver. (#779)
  • Add support for retry of failing downstream calls. (#778)

🐞 Fixes

  • Fix MQTT messages being lost due to connection loss. (#771)
  • Fix request timeout for health check calls. (#777)
  • Fix dependent integration test in pub-sub example. (#784)
  • Fix MQTT tests using mock Client and mock Token. (#791)

Changelog: v1.12.0...v1.13.0

v1.12.0

28 Jun 11:53
1dd86a4
Compare
Choose a tag to compare

Release v1.12.0

✨ Features

  • Add support of migrations for ClickHouse DB. (#750)
  • Add support for serving static files. (#674)
  • Add support of mocks for external datasources. (#749)

🛠 Enhancements

  • Update GO version to v1.22 (#741)
    NOTE: Starting this version, supported GO versions are >= v1.21

🐞 Fixes

  • Fix response of remote logging service. (#770)
  • Fix nil metrics issue for error cases. (#761)
  • Fix go.mod for examples. (#767)

Changelog: v1.11.0...v1.12.0

v1.11.0

21 Jun 11:11
c5c2a14
Compare
Choose a tag to compare

Release v1.11.0

✨ Features

  • Support for container in Auth Middlewares. (#738)

🐞 Fixes

  • Fix app_http_service_response metric population for error case. (#743)
  • Add configs for idle and max open connections. (#739)
  • Add logging methods in migrations logger. (#727)

Changelog: v1.10.0...v1.11.0