MCPcopy Create free account
hub / github.com/dataddo/pgq / isJSONObject

Function isJSONObject

consumer.go:702–709  ·  view source on GitHub ↗
(b json.RawMessage)

Source from the content-addressed store, hash-verified

700 }
701 if !isJSONObject(pgMsg.Payload) {
702 return nil, errors.New("payload is invalid JSON object")
703 }
704 return pgMsg.Payload, nil
705}
706
707func parseMetadata(pgMsg pgMessage) (map[string]string, error) {
708 if pgMsg.Metadata == nil {
709 return map[string]string{}, nil
710 }
711 var m map[string]string
712 if err := json.Unmarshal(pgMsg.Metadata, &m); err != nil {

Callers 2

parsePayloadFunction · 0.85
parseMetadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected