mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 13:25:40 +00:00
27 lines
463 B
Go
27 lines
463 B
Go
package common
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type WrappedPayload struct {
|
|
Payload any
|
|
Modules any
|
|
Sender any
|
|
End bool
|
|
}
|
|
|
|
func GetWrappedPayload(ctx context.Context, payload any) WrappedPayload {
|
|
templateData := WrappedPayload{Payload: payload}
|
|
modules := ctx.Value(ModulesContextKey)
|
|
if modules != nil {
|
|
templateData.Modules = modules
|
|
}
|
|
|
|
sender := ctx.Value(SenderContextKey)
|
|
if sender != nil {
|
|
templateData.Sender = sender
|
|
}
|
|
return templateData
|
|
}
|