Documentation ¶
Index ¶
- func GetContextLogger(ctx context.Context) *zap.Logger
- func GetContextSpan(ctx context.Context) oteltrace.Span
- func IsProducerNameExistsError(name string, err error) bool
- func NewContextWithValues(ctx context.Context, workerName string) context.Context
- func SetContextConsumer(ctx context.Context, consumer pulsar.Consumer)
- func SetContextProducer(ctx context.Context, publisher pulsar.Producer)
- type ContextKey
- type ContextValues
- func (c *ContextValues) Get(key string) string
- func (c *ContextValues) GetAndDeleteCurrentSpan() oteltrace.Span
- func (c *ContextValues) GetConsumer() pulsar.Consumer
- func (c *ContextValues) GetCurrentSpan() oteltrace.Span
- func (c *ContextValues) GetLogger() *zap.Logger
- func (c *ContextValues) GetProducer() pulsar.Producer
- func (c *ContextValues) GetWorkerName() string
- func (c *ContextValues) Keys() []string
- func (c *ContextValues) Set(key string, value string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContextWithValues ¶
Types ¶
type ContextKey ¶
type ContextKey string
const ( Values ContextKey = "notification-values" Producer ContextKey = "producer" Consumer ContextKey = "consumer" Logger ContextKey = "logger" WorkerName ContextKey = "worker-name" CurrentSpan ContextKey = "current-span" )
type ContextValues ¶
func GetContextValues ¶
func GetContextValues(ctx context.Context) *ContextValues
func (*ContextValues) Get ¶
func (c *ContextValues) Get(key string) string
func (*ContextValues) GetAndDeleteCurrentSpan ¶
func (c *ContextValues) GetAndDeleteCurrentSpan() oteltrace.Span
func (*ContextValues) GetConsumer ¶
func (c *ContextValues) GetConsumer() pulsar.Consumer
func (*ContextValues) GetCurrentSpan ¶
func (c *ContextValues) GetCurrentSpan() oteltrace.Span
func (*ContextValues) GetLogger ¶
func (c *ContextValues) GetLogger() *zap.Logger
func (*ContextValues) GetProducer ¶
func (c *ContextValues) GetProducer() pulsar.Producer
func (*ContextValues) GetWorkerName ¶
func (c *ContextValues) GetWorkerName() string
func (*ContextValues) Keys ¶
func (c *ContextValues) Keys() []string
func (*ContextValues) Set ¶
func (c *ContextValues) Set(key string, value string)
Click to show internal directories.
Click to hide internal directories.