(info *ObjectInfo, js JetStreamContext)
| 732 | } |
| 733 | |
| 734 | func publishMeta(info *ObjectInfo, js JetStreamContext) error { |
| 735 | // marshal the object into json, don't store an actual time |
| 736 | info.ModTime = time.Time{} |
| 737 | data, err := json.Marshal(info) |
| 738 | if err != nil { |
| 739 | return err |
| 740 | } |
| 741 | |
| 742 | // Prepare and publish the message. |
| 743 | mm := NewMsg(fmt.Sprintf(objMetaPreTmpl, info.Bucket, encodeName(info.ObjectMeta.Name))) |
| 744 | mm.Header.Set(MsgRollup, MsgRollupSubject) |
| 745 | mm.Data = data |
| 746 | if _, err := js.PublishMsg(mm); err != nil { |
| 747 | return err |
| 748 | } |
| 749 | |
| 750 | // set the ModTime in case it's returned to the user, even though it's not the correct time. |
| 751 | info.ModTime = time.Now().UTC() |
| 752 | return nil |
| 753 | } |
| 754 | |
| 755 | // AddLink will add a link to another object if it's not deleted and not another link |
| 756 | // name is the name of this link object |
no test coverage detected