mirror of
https://github.com/minio/minio.git
synced 2025-01-12 15:33:22 -05:00
event: Set contentType as well under NotificationEvent. (#4003)
This is an enhancement change to to cater support all the data fields present on the object. Currently we only send a subset of data which object info provides us. It also helps us keep a full namespace mirror on notification targets for efficient query.
This commit is contained in:
parent
fbe8b3259d
commit
28c5a887de
@ -139,6 +139,8 @@ type objectMeta struct {
|
|||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
Size int64 `json:"size,omitempty"`
|
Size int64 `json:"size,omitempty"`
|
||||||
ETag string `json:"eTag,omitempty"`
|
ETag string `json:"eTag,omitempty"`
|
||||||
|
ContentType string `json:"contentType:omitempty"`
|
||||||
|
UserDefined map[string]string `json:"userDefined:omitempty"`
|
||||||
VersionID string `json:"versionId,omitempty"`
|
VersionID string `json:"versionId,omitempty"`
|
||||||
Sequencer string `json:"sequencer"`
|
Sequencer string `json:"sequencer"`
|
||||||
}
|
}
|
||||||
|
@ -156,6 +156,7 @@ func newNotificationEvent(event eventData) NotificationEvent {
|
|||||||
if event.Type == ObjectRemovedDelete {
|
if event.Type == ObjectRemovedDelete {
|
||||||
nEvent.S3.Object = objectMeta{
|
nEvent.S3.Object = objectMeta{
|
||||||
Key: escapedObj,
|
Key: escapedObj,
|
||||||
|
VersionID: "1",
|
||||||
Sequencer: uniqueID,
|
Sequencer: uniqueID,
|
||||||
}
|
}
|
||||||
return nEvent
|
return nEvent
|
||||||
@ -166,6 +167,9 @@ func newNotificationEvent(event eventData) NotificationEvent {
|
|||||||
Key: escapedObj,
|
Key: escapedObj,
|
||||||
ETag: event.ObjInfo.MD5Sum,
|
ETag: event.ObjInfo.MD5Sum,
|
||||||
Size: event.ObjInfo.Size,
|
Size: event.ObjInfo.Size,
|
||||||
|
ContentType: event.ObjInfo.ContentType,
|
||||||
|
UserDefined: event.ObjInfo.UserDefined,
|
||||||
|
VersionID: "1",
|
||||||
Sequencer: uniqueID,
|
Sequencer: uniqueID,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user