Body returns an unmarshalled body that is kept in the document revision to produce shallow copies. If an unmarshalled copy is not available in the document revision, it makes a copy from the raw body bytes and stores it in document revision itself before returning the body.
()
| 235 | // If an unmarshalled copy is not available in the document revision, it makes a copy from the raw body |
| 236 | // bytes and stores it in document revision itself before returning the body. |
| 237 | func (rev *DocumentRevision) Body() (b Body, err error) { |
| 238 | |
| 239 | if err := b.Unmarshal(rev.BodyBytes); err != nil { |
| 240 | return nil, err |
| 241 | } |
| 242 | |
| 243 | return b, nil |
| 244 | } |
| 245 | |
| 246 | // Inject1xBodyProperties will inject special properties (_rev etc) into document body avoiding unnecessary marshal work |
| 247 | func (rev *DocumentRevision) Inject1xBodyProperties(ctx context.Context, db *DatabaseCollectionWithUser, requestedHistory Revisions, attachmentsSince []string, showExp bool) ([]byte, error) { |
no test coverage detected