有没有办法在 Web 客户端中监听 Google Cloud Storage 中的元数据更改?
Is there a way to listen for metadata changes in Google Cloud Storage in a web client?
我想设置一个 Firestore 文档侦听器,以便在元数据更改时自动触发回调。有办法吗?
来自 Cloud Storage events for Cloud Functions 上的文档:
Cloud Storage supports these events:
onArchive
: Only sent when a bucket has enabled object versioning. This event indicates that the live version of an object has become an archived version, either because it was archived or because it was overwritten by the upload of an object of the same name.
onDelete
: Sent when an object has been permanently deleted. This includes objects that are overwritten or are deleted as part of the bucket's lifecycle configuration. For buckets with object versioning enabled, this is not sent when an object is archived (see onArchive), even if archival occurs via the storage.objects.delete
method.
onFinalize
: Sent when a new object (or a new generation of an existing object) is successfully created in the bucket. This includes copying or rewriting an existing object. A failed upload does not trigger this event.
onMetadataUpdate
: Sent when the metadata of an existing object changes.
看起来 onMetadataUpdate
应该可以,尽管我承认我自己从未使用过该触发器。
我想设置一个 Firestore 文档侦听器,以便在元数据更改时自动触发回调。有办法吗?
来自 Cloud Storage events for Cloud Functions 上的文档:
Cloud Storage supports these events:
onArchive
: Only sent when a bucket has enabled object versioning. This event indicates that the live version of an object has become an archived version, either because it was archived or because it was overwritten by the upload of an object of the same name.
onDelete
: Sent when an object has been permanently deleted. This includes objects that are overwritten or are deleted as part of the bucket's lifecycle configuration. For buckets with object versioning enabled, this is not sent when an object is archived (see onArchive), even if archival occurs via thestorage.objects.delete
method.
onFinalize
: Sent when a new object (or a new generation of an existing object) is successfully created in the bucket. This includes copying or rewriting an existing object. A failed upload does not trigger this event.
onMetadataUpdate
: Sent when the metadata of an existing object changes.
看起来 onMetadataUpdate
应该可以,尽管我承认我自己从未使用过该触发器。