mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-28 01:56:30 +00:00
14ef098099
* [feature] Add http trace exporter, drop Jaeger Jaeger supports ingesting traces using the OpenTelemetry gRPC or HTTP methods. The Jaeger project has deprecated the old jaeger transport. * Add support for submitting traces over HTTP * Drop support for the old Jaeger protocol * Upgrade the trace libraries to v1.17 Fixes: #2176 Fixes: #2179
20 lines
386 B
Go
20 lines
386 B
Go
package utilities
|
|
|
|
import (
|
|
"bytes"
|
|
"io"
|
|
)
|
|
|
|
// IOReaderFactory takes in an io.Reader and returns a function that will allow you to create a new reader that begins
|
|
// at the start of the stream
|
|
func IOReaderFactory(r io.Reader) (func() io.Reader, error) {
|
|
b, err := io.ReadAll(r)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return func() io.Reader {
|
|
return bytes.NewReader(b)
|
|
}, nil
|
|
}
|