Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

23
pkg/common/payload.go Normal file
View File

@@ -0,0 +1,23 @@
package common
import (
"encoding/json"
"github.com/pkg/errors"
)
// Payload is the generic structure for payloads sent within Kafka messages
type Payload struct {
Handler string `json:"handler"`
Data json.RawMessage `json:"data"`
}
func (p *Payload) Marshal() ([]byte, error) {
data, err := json.Marshal(*p)
return data, errors.WithStack(err)
}
func (p *Payload) Unmarshal(data []byte) error {
err := json.Unmarshal(data, p)
return errors.WithStack(err)
}