Search Results for

Show / Hide Table of Contents

# Interface IGcsSigner

Bridges CoreUpload to a Google Cloud Storage resumable upload session. The core library takes no Google.Cloud.Storage SDK dependency — host apps register an implementation with DI:

    builder.Services.AddSingleton<IGcsSigner, MyGcsSigner>();

When no IGcsSigner is registered, the `/gcs/*` endpoints respond with `501 Not Implemented`.

###### Namespace: CoreUpload.Providers

###### Assembly: CoreUpload.dll

##### Syntax

    public interface IGcsSigner

### Methods

#### AbortUploadAsync(GcsAbortRequest, CancellationToken)

Cancels an in-progress resumable upload by issuing `DELETE` against the session URI.

##### Declaration

    Task AbortUploadAsync(GcsAbortRequest request, CancellationToken cancellationToken = default)

##### Parameters

Type | Name | Description
--- | --- | ---
GcsAbortRequest | request |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
Task |

#### CompleteUploadAsync(GcsCompleteRequest, CancellationToken)

Finalises the upload and returns metadata mapped to CoreUpload's standard UploadResult shape. GCS commits the object when the final byte range PUT succeeds, so this is typically a metadata-only step.

##### Declaration

    Task<GcsCompleteResult> CompleteUploadAsync(GcsCompleteRequest request, CancellationToken cancellationToken = default)

##### Parameters

Type | Name | Description
--- | --- | ---
GcsCompleteRequest | request |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
Task<GcsCompleteResult> |

#### CreateUploadAsync(GcsCreateRequest, CancellationToken)

Initiates a GCS resumable upload session (`POST /upload/storage/v1/b/{bucket}/o?uploadType=resumable`) and returns the session URI plus the chosen object name.

##### Declaration

    Task<GcsCreateResult> CreateUploadAsync(GcsCreateRequest request, CancellationToken cancellationToken = default)

##### Parameters

Type | Name | Description
--- | --- | ---
GcsCreateRequest | request |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
Task<GcsCreateResult> |

#### SignChunkAsync(GcsSignRequest, CancellationToken)

Optionally signs the URL used for a chunk PUT. Hosts that let the browser PUT directly to the session URI may return it unchanged.

##### Declaration

    Task<GcsSignResult> SignChunkAsync(GcsSignRequest request, CancellationToken cancellationToken = default)

##### Parameters

Type | Name | Description
--- | --- | ---
GcsSignRequest | request |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
Task<GcsSignResult> |