Documentation ¶
Overview ¶
Package context implement a setter and getter to put and get trm.Transaction from context.Context.
Index ¶
- Variables
- func Generate() trm.CtxKey
- type KeyGenerator
- type Manager
- func (c *Manager) ByKey(ctx context.Context, key trm.CtxKey) trm.Transaction
- func (c *Manager) Default(ctx context.Context) trm.Transaction
- func (c *Manager) SetByKey(ctx context.Context, key trm.CtxKey, t trm.Transaction) context.Context
- func (c *Manager) SetDefault(ctx context.Context, t trm.Transaction) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultManager = New(settings.DefaultCtxKey) //nolint:gochecknoglobals
DefaultManager is a trm.СtxManager with settings.DefaultCtxKey.
Functions ¶
Types ¶
type KeyGenerator ¶
type KeyGenerator struct {
// contains filtered or unexported fields
}
KeyGenerator is a generator of trm.CtxKey.
func (*KeyGenerator) Generate ¶
func (g *KeyGenerator) Generate() trm.CtxKey
Generate unique trm.CtxKey.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager implements trm.СtxManager.
Click to show internal directories.
Click to hide internal directories.