(data []byte)
| 1733 | } |
| 1734 | |
| 1735 | func parseEnvelopeSummary(data []byte) *Envelope { |
| 1736 | var env Envelope |
| 1737 | if err := json.Unmarshal(data, &env); err != nil { |
| 1738 | return nil |
| 1739 | } |
| 1740 | |
| 1741 | return &Envelope{ |
| 1742 | Protocol: strings.TrimSpace(env.Protocol), |
| 1743 | ID: strings.TrimSpace(env.ID), |
| 1744 | WorkspaceID: strings.TrimSpace(env.WorkspaceID), |
| 1745 | Kind: Kind(strings.TrimSpace(string(env.Kind))), |
| 1746 | Channel: strings.TrimSpace(env.Channel), |
| 1747 | Surface: normalizeOptionalSurface(env.Surface), |
| 1748 | ThreadID: normalizeOptionalIdentifier(env.ThreadID), |
| 1749 | DirectID: normalizeOptionalIdentifier(env.DirectID), |
| 1750 | From: strings.TrimSpace(env.From), |
| 1751 | To: normalizeOptionalIdentifier(env.To), |
| 1752 | Mentions: normalizeEnvelopeMentions(env.Mentions), |
| 1753 | WorkID: normalizeOptionalIdentifier(env.WorkID), |
| 1754 | ReplyTo: normalizeOptionalIdentifier(env.ReplyTo), |
| 1755 | TraceID: normalizeOptionalIdentifier(env.TraceID), |
| 1756 | CausationID: normalizeOptionalIdentifier(env.CausationID), |
| 1757 | TS: env.TS, |
| 1758 | ExpiresAt: cloneInt64Ptr(env.ExpiresAt), |
| 1759 | Body: cloneRawMessage(env.Body), |
| 1760 | Proof: cloneProof(env.Proof), |
| 1761 | Ext: cloneExtensionMap(env.Ext), |
| 1762 | } |
| 1763 | } |
| 1764 | |
| 1765 | func rejectionReceiptStatus(reason ReasonCode) (ReceiptStatus, bool) { |
| 1766 | switch reason { |
no test coverage detected