helper

package
v0.0.0-...-c228acb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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 GetGormFromContext

func GetGormFromContext(ctx context.Context) *gorm.DB

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 GetRedisClientFromContext

func GetRedisClientFromContext(ctx context.Context) *redis.Client

func LoggerFromCtx

func LoggerFromCtx(ctx context.Context) logger.Entry

func SetGormToContext

func SetGormToContext(ctx context.Context, dbConn *gorm.DB) context.Context

func SetRedisClientToContext

func SetRedisClientToContext(ctx context.Context, c *redis.Client) context.Context

func StartTransactionForEvent

func StartTransactionForEvent(nrApp newrelic.Application, job *eventbusclient.Message) newrelic.Transaction

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL