0.0.37 • Published 2 years ago

@google-cloud-suite/cloud-functions-update-storage-metadata v0.0.37

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@google-cloud-suite/cloud-functions-update-storage-metadata

Update object metadata with created trigger.

What is this?

  1. Save file.txt.metadata on your bucket
{
  "contentDisposition": "attachment:filename=textfile.txt"
}
  1. When file.txt is created, this function set metadata from file.txt.metadata to file.txt.

How to use?

  1. Prepare your Google Cloud Functions directory.
functions
  |- package.json
  |- index.js
  |- .gcloudignore
 ...
  1. Install
npm install @google-cloud-suite/cloud-functions-update-storage-metadata
  1. Handle stroage trigger

You can use handleStorageObjectCreated(params: InitParams) to initialize trigger. The followings are the property of InitParams:

  • metadataFileSuffix?: string
    • defaults: .metadata

Examples:

  • Using event target bucket for both source and destination.
const updateMetadata = require("@google-cloud-suite/cloud-functions-update-storage-metadata");
exports.updateMetadata = updateMetadata.handleStorageObjectCreated();
  1. Deploy
gcloud functions deploy updateMetadata \
--runtime nodejs10 \
--trigger-resource YOUR_BUCKET \
--trigger-event google.storage.object.finalize \
--project YOUR_PROJECT
0.0.37

2 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.20

4 years ago

0.0.21

4 years ago

0.0.22

4 years ago

0.0.23

4 years ago

0.0.24

4 years ago

0.0.25

4 years ago

0.0.26

4 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.29

3 years ago

0.0.10

5 years ago

0.0.11

5 years ago

0.0.12

5 years ago

0.0.13

5 years ago

0.0.14

5 years ago

0.0.15

5 years ago

0.0.9

5 years ago

0.0.16

5 years ago

0.0.8

5 years ago

0.0.17

5 years ago

0.0.18

5 years ago

0.0.19

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago