Google Cloud Storage Bucket

Implements

Constructors

Properties

bucketName: string
storage: Storage

Methods

  • generate file Id

    Parameters

    • fileName: string

      file name

    Returns string

    • file id
  • Generate public url

    Parameters

    • fileName: string

      file name

    Returns string

    • public url
  • Generate signed url of file

    Parameters

    • fileName: string

      file name

    • expiresSec: number = ...

      expiration second default 1 hour

    Returns Promise<string>

    • signed url
  • Generate signed url to upload the file

    Parameters

    • fileName: string

      file name

    • contentType: string

      allowed content type

    • contentLength: number

      allowed content length of the file

    • expires: number = ...

      expiration time of the signed url in ms, default: 15 mins

    Returns Promise<string>

    • the signed url

Generated using TypeDoc