Documentation
¶
Index ¶
Constants ¶
const IntuJSONVersion = "1"
IntuJSONVersion is the envelope format version stamped into every serialized IntuMessage. Consumers can use it for forward compatibility.
Variables ¶
This section is empty.
Functions ¶
func ResponseToIntuJSON ¶ added in v1.0.4
ResponseToIntuJSON converts a destination Response into IntuMessage JSON.
Types ¶
type ContentType ¶
type ContentType string
const ( ContentTypeRaw ContentType = "raw" ContentTypeJSON ContentType = "json" ContentTypeXML ContentType = "xml" ContentTypeCSV ContentType = "csv" ContentTypeHL7v2 ContentType = "hl7v2" ContentTypeHL7v3 ContentType = "hl7v3" ContentTypeFHIR ContentType = "fhir_r4" ContentTypeX12 ContentType = "x12" ContentTypeDICOM ContentType = "dicom" ContentTypeDelimited ContentType = "delimited" ContentTypeBinary ContentType = "binary" ContentTypeCCDA ContentType = "ccda" )
type DatabaseMeta ¶ added in v1.0.0
type Message ¶
type Message struct {
ID string
CorrelationID string
ChannelID string
Raw []byte
Transport string
ContentType ContentType
SourceCharset string // e.g. "iso-8859-1", "utf-16le"; empty means UTF-8
HTTP *HTTPMeta
File *FileMeta
FTP *FTPMeta
Kafka *KafkaMeta
TCP *TCPMeta
SMTP *SMTPMeta
DICOM *DICOMMeta
Database *DatabaseMeta
Metadata map[string]any
Timestamp time.Time
}
func FromIntuJSON ¶ added in v1.0.4
FromIntuJSON reconstructs a Message from IntuMessage JSON stored in content. Identity fields (id, correlationId, channelId, timestamp) are restored when present, making export/import/replay fully round-trippable. Falls back to generating fresh identity when the envelope predates version 1.
func Rebuild ¶ added in v1.0.7
Rebuild reconstructs a Message from a stored MessageRecord. It uses FromIntuJSON when the content is valid IntuMessage JSON, falling back to treating it as raw bytes. CorrelationID is always restored from the record. This is the canonical reprocess path used by both CLI and dashboard.
func (*Message) ClearTransportMeta ¶ added in v1.0.4
func (m *Message) ClearTransportMeta()
ClearTransportMeta resets all transport-specific metadata fields so a destination connector can stamp fresh values without stale source metadata.
func (*Message) CloneWithRaw ¶ added in v1.0.4
CloneWithRaw returns a shallow copy of the message with Raw replaced.
func (*Message) EnsureHTTP ¶ added in v1.0.0
EnsureHTTP initializes the HTTP meta if nil and returns it.
func (*Message) ToIntuJSON ¶ added in v1.0.4
ToIntuJSON serializes the Message as an IntuMessage JSON envelope. If Raw is valid UTF-8 the body is stored as a string; otherwise it is base64-encoded to avoid data corruption in JSON.