otgorm

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 7 Imported by: 0

README

otgorm

OpenTracing plugin for gorm.

Usage

package main

import (
	"github.com/yuewokeji/opentracing-go-plugins/module/otgorm"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

func main() {
	dsn := ""
	orm, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
	if err != nil {
		panic(err)
	}

	otgorm.RegisterCallbacks(orm)

	//do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCallbacks

func RegisterCallbacks(db *gorm.DB)

func Wrap

func Wrap(ctx context.Context, db *gorm.DB) *gorm.DB

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL