Documentation ¶
Index ¶
- Constants
- Variables
- func ContextFromMessage(msg *eventbusclient.Message) context.Context
- func GetGormFromContext(ctx context.Context) *gorm.DB
- func GetLogFieldFromMessage(message *eventbusclient.Message) logger.Fields
- func GetMessageFromDelivery(d amqp.Delivery) *eventbusclient.Message
- func GetRedisClientFromContext(ctx context.Context) *redis.Client
- func LoggerFromCtx(ctx context.Context) logger.Entry
- func SetGormToContext(ctx context.Context, dbConn *gorm.DB) context.Context
- func SetRedisClientToContext(ctx context.Context, c *redis.Client) context.Context
- func StartTransactionForEvent(nrApp newrelic.Application, job *eventbusclient.Message) newrelic.Transaction
- func StartTransactionForMessage(nrApp newrelic.Application, m *eventbusclient.Message) newrelic.Transaction
Constants ¶
View Source
const ( EntityIdAttr = "entityId" PayloadAttr = "payload" )
Variables ¶
View Source
var ErrDbEmpty = errors.New("db connection invalid")
View Source
var ErrRedisEmpty = errors.New("Redis connection invalid")
View Source
var LoggerFactory logger.Factory
Functions ¶
func ContextFromMessage ¶
func ContextFromMessage(msg *eventbusclient.Message) context.Context
Build the context from Message, the context now will have data for logging and tracing
func GetLogFieldFromMessage ¶
func GetLogFieldFromMessage(message *eventbusclient.Message) logger.Fields
From Message data, build the fields needed for logger
func GetMessageFromDelivery ¶
func GetMessageFromDelivery(d amqp.Delivery) *eventbusclient.Message
From rabbitmq delivery data, build the original message
func SetRedisClientToContext ¶
func StartTransactionForEvent ¶
func StartTransactionForEvent(nrApp newrelic.Application, job *eventbusclient.Message) newrelic.Transaction
func StartTransactionForMessage ¶
func StartTransactionForMessage(nrApp newrelic.Application, m *eventbusclient.Message) newrelic.Transaction
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.