Releases: justtrackio/gosoline
cloud/aws: added servicediscovery client and ec2 metadata provider
conc: make task-runner opt-in
What's Changed
You have to opt-in to use the task runner. Additionally, the task runner is now tagged as a background module. This helps to orderly shutdown your applications, after all tasks have been processed.
Add scheduler and task runner module + bug fixes
This release adds a task runner and scheduler module and contains various bug fixes.
The task runner (enabled by default) allows you to submit new tasks to be run in a controlled environment. It should only be a method of last resort to run go routines while still (somehow) tracking their results. IF ANY OF THEM FAILS, THE WHOLE TASK RUNNER WILL BE SHUT DOWN.
The scheduler module (which currently uses the task runner in the background) allows you to batch requests for a specified time together (or until reaching a batch size) and execute them all at once.
Other changes and bug fixes:
- The profiling module can now be enabled via a config setting without changing the code
- A possible leak of go routines was fixed in the kernel (when you execute multiple kernels after each other)
- A race condition was fixed where the kernel would report a failed module as successful
v0.18.4
In this release i've added a CreateUriHandler
func in the httpserver package to support Handlers which supply an input struct with the tag (uri:"xyz"
).
v0.18.3
Fixes the selection of default credentials when compiling with tag integration to use against localstack.
v0.18.2
Add test log recording for assertions based on recorded logs
What's Changed
- appctx: Add documentation by @bt-justtrack in #1101
- suite, env: Implement optional recording of emitted logs for use in test assertions by @bt-justtrack in #1103
The main change is the ability of test/suite.Suite to now accept an option suite.WithLogRecording()
which causes the environment
of the test to collect all log statements issued on its logger.
The test can then get these and make assertions based on them:
logs := s.Env().Logs().Filter(func(lr env.LogRecord) bool {
return strings.Contains(lr.FormattedMsg, "foobar")
})
s.Len(logs, 1)
Added goose db migration provider (new default)
In this release we are adding the goose db migration provider and make it default.
This breaks setups with already existing migration configurations.
You can switch this back by providing db.x.migrations.provider: golang-migrate
The adjustment to make goose work is however comparibly simple:
- remove the
file://
part from the db.x.migrations.path property in your config (or env vars) - generate an initial db migration containing your current schema (see later code snippet)
- run
goose status
against your db, so it create thegoose_db_version
table - enter your initial migration into that table and set it as is_applied=1 with the current timestamp
- check again with
goose status
to ensure goose sees your migration as applied
How to create an initial db migration from your current schema
export mysql_host=your-mysql-host
export mysql_user=your-mysql-user
export mysql_db=your-mysql-db
export mysql_password=your-mysql-password
export temp_file=tables.sql
mysql -u $mysql_user -p$mysql_password -h $mysql_host -e 'show tables;' $mysql_db 2>/dev/null | grep -v Tables_in_$mysql_db | grep -v _history_entries | grep -v goose_db_version | xargs mysqldump -u $mysql_user -h $mysql_host -p$mysql_password -d -n --set-gtid-purged=OFF --single-transaction --skip-triggers $mysql_db > $temp_file
export initial_dump_filename=20240415141306_initial.sql
echo '-- +goose Up' > $initial_dump_filename
cat $temp_file >> $initial_dump_filename
echo '-- +goose Down' >> $initial_dump_filename
echo '-- +goose StatementBegin' >> $initial_dump_filename
echo '-- +goose StatementEnd' >> $initial_dump_filename
rm $temp_file
Running goose on the cli
GOOSE_DRIVER=mysql GOOSE_DBSTRING=username:password@tcp(db_hostname)/database?parseTime=true goose status
GOOSE_DRIVER=mysql GOOSE_DBSTRING=username:password@tcp(db_hostname)/database?parseTime=true goose -allow-missing up
Official goose documentation
Please refer to the official goose documentation in case you have any issues or want to know more about goose.
Add additional config options for the HTTP transport for a client
This release adds additional config fields to configure the HTTP transport used by the HTTP client provided by gosoline. The added defaults are:
http_client:
default:
transport:
tls_handshake_timeout: 10s
disable_keep_alives: false
disable_compression: false
max_idle_conns: 100
max_idle_conns_per_host: 0
max_conns_per_host: 0
idle_conn_timeout: 90s
response_header_timeout: 0s
expect_continue_timeout: 1s
max_response_header_bytes: 0
write_buffer_size: 0
read_buffer_size: 0
dialer:
keep_alive: 30s
timeout: 30s
dual_stack: true
fallback_delay: 0s
Additionally, this release fixes a small bug in the kinsumer (which would cause the kinsumer to fail to find the client it just wrote to ddb in rare cases) and changes the return type of mdlsub.NewPublisher
to mdlsub.Publisher
(instead of *mdlsub.publisher
).
Revert "Add NotFoundTtl setting to in-memory kvstore"
Reverts the last release for the in-memory kvstore settings as it is not working as expected.