Releases: mautrix/go-util
Releases · mautrix/go-util
v0.8.3
v0.8.2
- (ffmpeg) Added wrapper functions for
ffprobe
. - (emojirunes) Added method to check if a string is only emojis.
- (unicodeurls) Updated data sheets used by emojirunes, variationselectors and other packages to Unicode 16.
- (dbutil) Added support for mass inserts with no static parameters.
v0.8.1
- Breaking change (lottie) Improved interface to take a destination file name rather than returning bytes. The method was internally using a file anyway, so forcing reading it into memory was a waste.
- (ffmpeg) Added
ConvertPathWithDestination
to specify destination file manually. - (exhttp) Added utility for applying middlewares to any HTTP handler.
- (exfmt) Made duration formatting more customizable.
- (dbutil) Changed table existence checks during schema upgrades to properly return errors instead of panicking.
- (dbutil) Fixed
sqlite-fkey-off
transaction mode.
v0.8.0
- (dbutil) Changed litestream package to allow importing as no-op even when cgo is disabled.
- (ptr) Added
NonZero
andNonDefault
helpers to get nil if the value is zero/default or a pointer to the value otherwise. - (ffmpeg) Fixed files not being removed if conversion fails.
- (pblite) Added pblite (protobuf as JSON arrays) en/decoder.
- (exhttp) Added utilities for JSON responses, CORS headers and other things.
- (glob) Added utility for parsing Matrix globs into efficient matchers, with a fallback to regex for more complicated patterns.
- (exsync) Added
Size
,Pop
,ReplaceAll
andAsList
forSet
. - (variationselector) Fixed plain numbers being emojified by
Add
.
v0.7.0
- Bumped minimum Go version to 1.22.
- (curl) Added
Parse
function to parse a curl command exported from browser devtools. - (exfmt) Moved
FormatCurl
tocurl
package. - (exslices) Added
DeduplicateUnsorted
utility for deduplicating items in a list while preserving order. - (exsync) Deprecated
ReturnableOnce
in favor of the standard library'ssync.OnceValues
. - (exsync) Added
Event
which works similar to Python'sasyncio.Event
. - (confusable) Added implementation of confusable detection from UTS #39.
- (dbutil) Added deadlock detection option which panics if a database call is made without the appropriate transaction context in a goroutine which previously entered a database transaction.
v0.6.0
- (dbutil) Added
-- transaction: sqlite-fkey-off
mode to upgrades, which allows safer upgrades that disable foreign keys without having to disable transactions entirely.- Breaking change:
UpgradeTable.Register
now takes a TxnMode instead of a bool as the 5th parameter. - Breaking change:
Database.DoTxn
now takes*dbutil.TxnOptions
instead of*sql.TxOptions
.nil
is still allowed and the existing fields are still supported, but there's a new field too. - Breaking change:
Database.Conn
was renamed toExecable
to avoid confusion with the newAcquireConn
method (Execable
just returns the current transaction or database,AcquireConn
acquires a connection for exclusive use).
- Breaking change:
- (dbutil) Added finalizer for RowIter to panic if the rows aren't iterated.
- (dbutil) Changed
QueryOne
to return a zero value (usually nil) if theScan
method returns an error. - (progress) Implemented
io.Seeker
inReader
. - (ptr) Added new utilities for creating pointers to arbitrary values, as well as safely dereferencing pointers and making shallow clones.
- (exslices) Added functions to cast slices to different types.
- (gnuzip) Added wrappers for gzip that operate on
[]byte
s instead ofio.Reader
/Writer
s. - (lottie) Added wrapper for lottieconverter similar to ffmpeg.
- (variationselector) Fixed edge cases where
Add
andFullyQualify
produced invalid output.
v0.5.0
- Breaking change (configupgrade) Changed
Helper
into an interface. - (configupgrade) Added
ProxyHelper
that prepends a given path to all calls to a targetHelper
. - (dbutil) Added support for notating line filters as
(line commented)
to indicate that they should be uncommented when the filter matches. - (dbutil) Prevented accidentally using the transaction of another database connection by mixing contexts.
- (fallocate) Added utility for allocating file space on disk. Currently compatible with Linux (including Android) and macOS.
- (requestlog) Added utility for HTTP access logging.
- (progress) Added
io.Reader
andio.Writer
wrappers that support monitoring progress of the reading/writing.
v0.4.2
v0.4.1
- (exfmt) Added utility for converting HTTP requests to
curl
commands. - (exmime) Added hardcoded extension override for
audio/mp4
->.m4a
. - (dbutil) Added
UnixPtr
,UnixMilliPtr
andConvertedPtr
helpers for convertingtime.Time
into*int64
so that zero times are nil and other times are unix. - (dbutil) Added
UntypedNil
utility for avoiding typed nils, andJSONPtr
for wrapping a struct in the existingJSON
utility usingUntypedNil
. - (dbutil) Added periodic logs to
DoTxn
if the transaction takes more than 5 seconds.
v0.4.0
- (jsonbytes) Added utilities for en/decoding byte slices as unpadded base64.
- (jsontime) Fixed serialization of Unix(Micro|Nano)String types.
- (exzerolog) Added helper function for setting sensible zerolog globals such as CallerMarshalFunc, default loggers and better level colors.
- (dbutil) Added helper for wrapping a raw slice in a RowIter.
- This is useful for interfaces that return RowIters to allow implementing the interface without SQL.
- The RowIter interface may be moved to a separate package in the future to further separate it from SQL databases.
- (dbutil) Added helper for converting RowIter to map.