Skip to content

Releases: justtrackio/gosoline

cloud/aws: added servicediscovery client and ec2 metadata provider

06 Jun 09:33
Compare
Choose a tag to compare

The metadata provider service allows for easy access for things like the AWS instance availability zone or many other parameters.

conc: make task-runner opt-in

06 Jun 08:35
97bfb0f
Compare
Choose a tag to compare

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

04 Jun 12:15
Compare
Choose a tag to compare

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

23 May 12:03
Compare
Choose a tag to compare

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

22 May 13:27
v0.18.3
fb0d40f
Compare
Choose a tag to compare

Fixes the selection of default credentials when compiling with tag integration to use against localstack.

v0.18.2

21 May 08:20
v0.18.2
6c6bae0
Compare
Choose a tag to compare

Fixes an issue with the feature introduced in v0.18.1 where recorded logs were never returned when calling env.Logs().

Add test log recording for assertions based on recorded logs

16 May 15:49
v0.18.1
b572d75
Compare
Choose a tag to compare

What's Changed

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)

16 May 13:35
Compare
Choose a tag to compare

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 the goose_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

16 May 08:40
Compare
Choose a tag to compare

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"

10 May 08:31
Compare
Choose a tag to compare

Reverts the last release for the in-memory kvstore settings as it is not working as expected.