v1.19.0
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, denotingsecond (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 theAddFileStore
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 Content206
-
Enhance Observability for FTP
Logs formatting and structuring have been improved.
A new histogram metricapp_ftp_stats
has been introduced to populate data for execution duration with labels astype
andstatus
.
-
Logger mock methods for testing purpose
To help test the logging methods, mocks have now been generated withmockgen
, 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 providingModePerm
(777
) permissions.