trace.go 329 B

1234567891011121314151617181920212223
  1. package database
  2. import "git.bvbej.com/bvbej/base-golang/pkg/trace"
  3. type Trace = trace.T
  4. type Option func(*option)
  5. func WithTrace(t Trace) Option {
  6. return func(opt *option) {
  7. if t != nil {
  8. opt.Trace = t.(*trace.Trace)
  9. }
  10. }
  11. }
  12. func newOption() *option {
  13. return &option{}
  14. }
  15. type option struct {
  16. Trace *trace.Trace
  17. }