ipld-eth-server/vendor/gopkg.in/DataDog/dd-trace-go.v1/contrib/tidwall/buntdb/option.go
Rob Mulholand 560305f601 Update dependencies
- uses newer version of go-ethereum required for go1.11
2018-09-13 16:14:35 -05:00

31 lines
599 B
Go

package buntdb
import "context"
type config struct {
serviceName string
ctx context.Context
}
func defaults(cfg *config) {
cfg.serviceName = "buntdb"
cfg.ctx = context.Background()
}
// An Option customizes the config.
type Option func(cfg *config)
// WithContext sets the context for the transaction.
func WithContext(ctx context.Context) Option {
return func(cfg *config) {
cfg.ctx = ctx
}
}
// WithServiceName sets the given service name for the transaction.
func WithServiceName(serviceName string) Option {
return func(cfg *config) {
cfg.serviceName = serviceName
}
}