Documentation ¶
Overview ¶
Package settings implements trm.Settings.
Index ¶
- Variables
- type Opt
- type Settings
- func (s Settings) Cancelable() bool
- func (s Settings) CancelableOrNil() *bool
- func (s Settings) CtxKey() trm.CtxKey
- func (s Settings) CtxKeyOrNil() *trm.CtxKey
- func (s Settings) EnrichBy(external trm.Settings) (res trm.Settings)
- func (s Settings) Propagation() trm.Propagation
- func (s Settings) PropagationOrNil() *trm.Propagation
- func (s Settings) SetCancelable(t *bool) trm.Settings
- func (s Settings) SetCtxKey(key *trm.CtxKey) trm.Settings
- func (s Settings) SetPropagation(p *trm.Propagation) trm.Settings
- func (s Settings) SetTimeout(t *time.Duration) trm.Settings
- func (s Settings) TimeoutOrNil() *time.Duration
Constants ¶
This section is empty.
Variables ¶
var DefaultCtxKey = ctxKey{} //nolint:gochecknoglobals
DefaultCtxKey is a default key to store Transaction.
Functions ¶
This section is empty.
Types ¶
type Opt ¶
Opt is type to set Settings' properties.
func WithCancelable ¶
WithCancelable sets up possibility to cancel child goroutines when parent trm.Transaction was canceled.
func WithCtxKey ¶
func WithCtxKey(key trm.CtxKey) Opt
WithCtxKey sets up trm.CtxKey for the trm.Settings.
func WithPropagation ¶
func WithPropagation(p trm.Propagation) Opt
WithPropagation sets up a trm.Propagation for the trm.Settings.
func WithTimeout ¶
WithTimeout sets up a timeout for the trm.trm.
type Settings ¶
type Settings struct {
// contains filtered or unexported fields
}
Settings is an implementation of trm.Settings.
func (Settings) Cancelable ¶
Cancelable defines that parent trm.Transaction can cancel children transactions.
func (Settings) CancelableOrNil ¶
CancelableOrNil returns Cancelable or nil.
func (Settings) CtxKey ¶
func (s Settings) CtxKey() trm.CtxKey
CtxKey returns key(trm.CtxKey) to get trm.Transaction from context.Context.
func (Settings) CtxKeyOrNil ¶
func (s Settings) CtxKeyOrNil() *trm.CtxKey
CtxKeyOrNil returns key(*trm.CtxKey) or nil.
func (Settings) EnrichBy ¶
func (s Settings) EnrichBy(external trm.Settings) (res trm.Settings)
EnrichBy fills nil properties from external Settings.
func (Settings) Propagation ¶
func (s Settings) Propagation() trm.Propagation
Propagation returns trm.Propagation.
func (Settings) PropagationOrNil ¶
func (s Settings) PropagationOrNil() *trm.Propagation
PropagationOrNil returns trm.Propagation or nil.
func (Settings) SetCancelable ¶
SetCancelable sets Cancelable(*bool).
func (Settings) SetCtxKey ¶
func (s Settings) SetCtxKey(key *trm.CtxKey) trm.Settings
SetCtxKey sets key(*trm.CtxKey) to store trm.Transaction in context.Context.
func (Settings) SetPropagation ¶
func (s Settings) SetPropagation(p *trm.Propagation) trm.Settings
SetPropagation sets *trm.Propagation.
func (Settings) SetTimeout ¶
SetTimeout sets *time.Duration for trm.Transaction.
func (Settings) TimeoutOrNil ¶
TimeoutOrNil returns time.Duration of the trm.Transaction.