12345678910111213141516171819202122232425262728 |
- package mongo
- import (
- "time"
- "github.com/tal-tech/go-zero/core/syncx"
- )
- var slowThreshold = syncx.ForAtomicDuration(defaultSlowThreshold)
- type (
- options struct {
- timeout time.Duration
- }
- // Option defines the method to customize a mongo model.
- Option func(opts *options)
- )
- func SetSlowThreshold(threshold time.Duration) {
- slowThreshold.Set(threshold)
- }
- func defaultOptions() *options {
- return &options{
- timeout: defaultTimeout,
- }
- }
|