diff options
Diffstat (limited to 'vendor/github.com/uptrace/opentelemetry-go-extra/otelsql/tx.go')
-rw-r--r-- | vendor/github.com/uptrace/opentelemetry-go-extra/otelsql/tx.go | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/vendor/github.com/uptrace/opentelemetry-go-extra/otelsql/tx.go b/vendor/github.com/uptrace/opentelemetry-go-extra/otelsql/tx.go deleted file mode 100644 index c4bd55e13..000000000 --- a/vendor/github.com/uptrace/opentelemetry-go-extra/otelsql/tx.go +++ /dev/null @@ -1,38 +0,0 @@ -package otelsql - -import ( - "context" - "database/sql/driver" - - "go.opentelemetry.io/otel/trace" -) - -type otelTx struct { - ctx context.Context - tx driver.Tx - instrum *dbInstrum -} - -var _ driver.Tx = (*otelTx)(nil) - -func newTx(ctx context.Context, tx driver.Tx, instrum *dbInstrum) *otelTx { - return &otelTx{ - ctx: ctx, - tx: tx, - instrum: instrum, - } -} - -func (tx *otelTx) Commit() error { - return tx.instrum.withSpan(tx.ctx, "tx.Commit", "", - func(ctx context.Context, span trace.Span) error { - return tx.tx.Commit() - }) -} - -func (tx *otelTx) Rollback() error { - return tx.instrum.withSpan(tx.ctx, "tx.Rollback", "", - func(ctx context.Context, span trace.Span) error { - return tx.tx.Rollback() - }) -} |