Type alias MultiServerUploadOptions<S, B>

MultiServerUploadOptions<S, B>: UploadOptions<S, B> & {
    isMedia?: boolean;
    mediaUploadBehavior?: "first" | "any";
    mediaUploadFallback?: boolean;
    mirrorTimeout?: number;
    onError?: ((server, sha256, blob, error) => void);
    onStart?: ((server, sha256, blob) => void);
    onUpload?: ((server, sha256, blob) => void);
}

Type Parameters

Type declaration

  • Optional isMedia?: boolean

    Signals this blob should be treated as a media file and should attempt to use BUD-05 /media endpoint for upload on first server

    Default

    false
    
  • Optional mediaUploadBehavior?: "first" | "any"

    If isMedia is enabled, this determines how /media endpoints should be prioritized

    • "first" Only use the first server in the list to optimize the media
    • "any" Use any server in the list to optimize the media

    Default

    "first"
    
  • Optional mediaUploadFallback?: boolean

    If isMedia is enabled, should the raw blob be uploaded if no /media endpoint can be found

    Default

    false
    
  • Optional mirrorTimeout?: number

    Timeout for mirror requests

    Default

    5000
    
  • Optional onError?: ((server, sha256, blob, error) => void)

    called when upload to a server fails

      • (server, sha256, blob, error): void
      • Parameters

        • server: S
        • sha256: string
        • blob: B
        • error: Error

        Returns void

  • Optional onStart?: ((server, sha256, blob) => void)

    called on blob when uploaded to started to a server

      • (server, sha256, blob): void
      • Parameters

        • server: S
        • sha256: string

          the hash of the blob being uploaded or mirrored

        • blob: B

          the original blob

        Returns void

  • Optional onUpload?: ((server, sha256, blob) => void)

    called when upload to a server is complete

      • (server, sha256, blob): void
      • Parameters

        • server: S
        • sha256: string
        • blob: B

        Returns void