The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import * as Binding from "alchemy/Binding"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import type { Bucket } from "./Bucket.ts"; |
| 4 | import type { ReadBucketClient } from "./ReadBucket.ts"; |
| 5 | import type { WriteBucketClient } from "./WriteBucket.ts"; |
| 6 | |
| 7 | export interface ReadWriteBucketClient extends ReadBucketClient, WriteBucketClient {} |
| 8 | |
| 9 | /** |
| 10 | * Read and write access to a Cloud Storage {@link Bucket}. Grants |
| 11 | * `roles/storage.objectUser` on the bucket only. |
| 12 | * |
| 13 | * ### Reading and writing |
| 14 | * **Example:** Copy within a bucket |
| 15 | * ```typescript |
| 16 | * const files = yield* GCP.Storage.ReadWriteBucket(bucket); |
| 17 | * const source = yield* files.get("in.txt"); |
| 18 | * if (source) yield* files.put("out.txt", source.body); |
| 19 | * // …provided with Effect.provide(GCP.Storage.ReadWriteBucketHttp) |
| 20 | * ``` |
| 21 | * |
| 22 | * @binding |
| 23 | * @category Storage |
| 24 | */ |
| 25 | export interface ReadWriteBucket extends Binding.Service< |
| 26 | ReadWriteBucket, |
| 27 | "GCP.Storage.ReadWriteBucket", |
| 28 | (bucket: Bucket) => Effect.Effect<ReadWriteBucketClient> |
| 29 | > {} |
| 30 | |
| 31 | export const ReadWriteBucket = Binding.Service<ReadWriteBucket>("GCP.Storage.ReadWriteBucket"); |