Skip to content

v1.19.0

Compare
Choose a tag to compare
@srijan-27 srijan-27 released this 02 Sep 11:48
· 711 commits to development since this release
78dcc62

Release v1.19.0

✨ Features

  • Support for second in cron format
    Cron job schedules can now be more precise with an optional addition field for seconds.
    Format can now be either 5 part or 6 part, denoting second (optional), minute, hour, day_of_month, month, day_of_week.

    Example:

    // Cron job to run every 10 second
    app.AddCronJob("*/10 * * * * *", "counter", count)
    // Cron job to run every 5 minute
    app.AddCronJob("*/5 * * * *", "counter", count)
    
  • Support for SFTP operations
    FileStore can now be initialised as SFTP with the AddFileStore method.
    Since, SFTP is an external datasource, it can be imported by:
    go get gofr.dev/pkg/gofr/datasource/file/sftp

    Example:
    app.AddFileStore(sftp.New(&sftp.Config{Host: "127.0.0.1", User: "user", Password: "password", Port: 22}))

    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
     ReadDir(dir string) ([]FileInfo, error)
     Stat(name string) (FileInfo, error)
     Getwd() (string, error)
    

🛠 Enhancements

  • Response with Partial Content status code
    If the handler returns both data as well as error, then the status code would now be Partial Content 206

  • Enhance Observability for FTP
    Logs formatting and structuring have been improved.
    A new histogram metric app_ftp_stats has been introduced to populate data for execution duration with labels as type and status.
    Image

  • Logger mock methods for testing purpose
    To help test the logging methods, mocks have now been generated with mockgen, instead of manually creating for every datasource.

🐞 Fixes

  • Resolved permission issues in directories
    While creating new directory, the permissions were missing for the directory. Fixed that by providing ModePerm (777) permissions.