forked from avito-tech/go-transaction-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.go
37 lines (30 loc) · 1009 Bytes
/
settings.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package trm
//go:generate mockgen -source=$GOFILE -destination=drivers/mock/$GOFILE -package=mock
import (
"time"
)
// Settings is the configuration of the Manager.
// Preferable to implement as an immutable struct.
//
// settings.Settings is a default implementation of Settings.
//
//nolint:interfacebloat
type Settings interface {
// EnrichBy fills nil properties from external Settings.
EnrichBy(external Settings) Settings
// CtxKey returns trm.CtxKey for the trm.Transaction.
CtxKey() CtxKey
CtxKeyOrNil() *CtxKey
SetCtxKey(*CtxKey) Settings
// Propagation returns trm.Propagation.
Propagation() Propagation
PropagationOrNil() *Propagation
SetPropagation(*Propagation) Settings
// Cancelable defines that parent trm.Transaction can cancel child trm.Transaction or goroutines.
Cancelable() bool
CancelableOrNil() *bool
SetCancelable(*bool) Settings
// TimeoutOrNil returns time.Duration of the trm.Transaction.
TimeoutOrNil() *time.Duration
SetTimeout(*time.Duration) Settings
}