Releases: retailcrm/mg-transport-core
Releases · retailcrm/mg-transport-core
Add localizer interface
v2.2.1 Add localizer interface
Replace old Sentry client with the new SDK
* replace old Sentry client with the new SDK * do not initialize Sentry SDK twice, correct panic processing * account prefix for panics * log errors with account context data * tests * linter fixes * removed 1.18 from available versions
Trans template in FuncMap
v2.1.1 Trans template in FuncMap
Add public methods for gettings allowed domains
v2.1.0 Add public methods for gettings allowed domains
Credentials backport
v2.0.1 Credentials backport
Сredentials backport
v1.8.6 Сredentials backport
Refactoring and new features
Changelog mg-transport-core
- [breaking change]: TLS 1.2 as a minimal TLS version for
HTTPClientBuilder
. UseUseTLS10
method to restore old behavior. - [breaking change]: All error-related utilities with an exception for the
Sentry
component were moved toerrorutil
. - [breaking change]:
core.GetContextLocalizer
andcore.MustGetContextLocalizer
will set appropriate language tag based on browser language. UseSetLanguage(language.English)
call to restore previous behavior. - [breaking change]:
core.JobLogFunc
is removed completely.core.JobFunc
,core.JobErrorHandler
andcore.JobPanicHandler
are usinglogger.Logger
instead ofcore.JobLogFunc
. - [breaking change]:
core.ErrorCollector
has been removed; useerrorutil.Collector
orerrorutil.Collect
instead. - [breaking change]:
core.ErrInsufficientScopes
has been moved to the another package; useerrorutil.ErrInsufficientScopes
instead. - [breaking change]:
core.ScopesList
has been moved to the another package; useerrorutil.ScopesList
instead. - [breaking change]:
core.NewInsufficientScopesErr
has been moved to the another package; useerrorutil.NewInsufficientScopesErr
instead. - [breaking change]:
core.ErrorResponse
has been moved to the another package; useerrorutil.Response
instead. - [breaking change]:
core.ErrorsResponse
has been moved to the another package; useerrorutil.ListResponse
instead. - [breaking change]:
core.GetErrorResponse
has been moved to the another package; useerrorutil.GetErrorResponse
instead. - [breaking change]:
core.BadRequest
has been moved to the another package; useerrorutil.BadRequest
instead. - [breaking change]:
core.InternalServerError
has been moved to the another package; useerrorutil.InternalServerError
instead. - [breaking change]:
core.LoggerInterface
has been moved to the another package; uselogger.Logger
instead. - [breaking change]:
core.Logger
has been moved to the another package; uselogger.StandardLogger
instead. - [breaking change]:
core.NewLogger
has been moved to the another package; uselogger.NewStandard
instead. - [breaking change]:
core.DefaultLogFormatter
has been moved to the another package; uselogger.DefaultLogFormatter
instead. - [breaking change]:
core.TranslationsExtractor
has been moved to the another package; usetestutil.TranslationsExtractor
instead. - [breaking change]:
core.NewTranslationsExtractor
has been moved to the another package; usetestutil.NewTranslationsExtractor
instead. - [breaking change]:
core.Migrate
has been moved to the another package; usedb.Migrate
instead. - [breaking change]:
core.MigrationInfo
has been moved to the another package; usedb.MigrationInfo
instead. - [breaking change]:
core.Migrations
has been moved to the another package; usedb.Migrations
instead. - [breaking change]:
core.ORM
has been moved to another package; usedb.ORM
instead. - [breaking change]:
core.NewORM
has been moved to the another package; usedb.NewORM
instead. - [breaking change]:
core.NewMigrationCommand
has been moved to the another package; usedb.NewMigrationCommand
instead. - [breaking change]:
core.Connection
has been moved to the another package; usemodels.Connection
instead. - [breaking change]:
core.Account
has been moved to the another package; usemodels.Account
instead. - [breaking change]:
core.User
has been moved to another package; usemodels.User
instead. - [breaking change]:
core.Accounts
has been moved to the another package; usemodels.Accounts
instead. - [breaking change]:
core.ConfigInterface
has been moved to the another package; useconfig.Configuration
instead. - [breaking change]:
core.Config
has been moved to the another package; useconfig.Config
instead. - [breaking change]:
core.ConfigAWS
has been moved to another package; useconfig.AWS
instead. - [breaking change]:
core.InfoInterface
has been moved to the another package; useconfig.InfoInterface
instead. - [breaking change]:
core.Info
has been moved to another package; useconfig.Info
instead. - [breaking change]:
core.DatabaseConfig
has been moved to the another package; useconfig.DatabaseConfig
instead. - [breaking change]:
core.HTTPClientConfig
has been moved to the another package; useconfig.HTTPClientConfig
instead. - [breaking change]:
core.HTTPServerConfig
has been moved to the another package; useconfig.HTTPServerConfig
instead. - [breaking change]:
core.NewConfig
has been moved to the another package; useconfig.NewConfig
instead. - [breaking change]:
core.Utils
has been moved to the another package; useutil.Utils
instead. - [breaking change]:
core.CSRF
and related symbols have been moved to another package; usemiddleware.CSRF
instead. - [breaking change]:
core.ConnectionConfig
and related symbols have been moved to the another package; usemiddleware.ConnectionConfig
instead. - [breaking change]:
core.VerifyConnectRequest
and related symbols have been moved to the another package; usemiddleware.VerifyConnectRequest
instead. - [breaking change]:
core.MustGetConnectRequest
and related symbols have been moved to the another package; usemiddleware.MustGetConnectRequest
instead. - [breaking change]:
core.HTTPClientBuilder
and related symbols have been moved to the another package; usehttputil.HTTPClientBuilder
instead. - [breaking change]:
core.(*HTTPClientBuilder).FromEngine
has been removed; use(*HTTPClientBuilder).FromConfig((*core.Engine).GetHTTPClientConfig())
instead. - [feature]:
db.(*ORM).createDB
is now exported -db.(*ORM).CreateDB
- [feature]:
core.GetRootLanguageTag
function that returns root language tag for region-scoped language tags. - [feature]:
errorutil.Collector
component (better replacement for thecore.ErrorCollector
). - [feature]:
errorutil.Collect
method (drop-in replacement for thecore.ErrorCollector
). - [feature]:
errorutil.Unauthorized
method - returns error withhttp.Unauthorized
code. - [feature]:
errorutil.Forbidden
method - returns error withhttp.Forbidden
code. - [feature]:
core.(*Localizer).UnauthorizedLocalized
method - localized version oferrorutil.Unauthorized
. - [feature]:
core.(*Localizer).ForbiddenLocalized
method - localized version oferrorutil.Forbidden
. - [feature]:
core.(*Localizer).InternalServerErrorLocalized
method - localized version oferrorutil.InternalServerError
. - [feature]:
logger.Nil
-logger.Logger
implementation that does nothing (can be used to disable logging without touching logging calls). Instantiate usinglogger.NewNil
. - [feature]:
logger.NewBase
- default constructor forgithub.com/op/go-logging
logger which is being used as a backend for thelogger.StandardLogger
. - [feature]:
(*logger.StandardLogger).SetBaseLogger
method - setter for the underlying backend logger (fromgithub.com/op/go-logging
). - [feature]:
logger.PrefixDecorator
to decorate logger with any additional prefix. Uselogger.DecorateWithPrefix
. - [feature]:
logger.AccountLoggerDecorator
- logger that logs messages with predefined prefix. Prefix contains information about component name, connection and account identifiers. All of those including prefix format are updatable. - [feature]:
testutil.BufferLogger
-logger.Logger
implementation that writes to the underlying buffer. Instantiate usingtestutil.NewBufferedLogger
. This implementation is placed insidetestutil
because it is only useful in tests. - [feature]:
testutil.AssertNoUnmatchedRequests
- asserts that there are no unmatched requests. Prints out all of those requests otherwise. - [feature]:
testutil.DeleteCreatedEntities
- records all the entities inserted into the DB; removes them all then necessary. - [infrastructure]: Update golangci-lint to v1.42.1.
- [fix]: Structures optimization (reduces memory usage).
- [fix]: Preallocation for some buffers.
- [fix]: Fixes for doc comments.
- [fix]: Fix for all linter errors.
One-step connection middlewares
v1.8.5 One-step connection middlewares (#34)
Improve errors handling
v1.8.4 Improve errors handling
Add secret field for transport
v1.8.3 Add secret field for transport