...
1 package storage
2
3 import gcs "cloud.google.com/go/storage"
4
5
6 type Storage struct {
7 *gcs.Client
8 }
9
10 type Bucket struct {
11 *gcs.BucketHandle
12 }
13
14
15 type storageOpts struct {
16 client *gcs.Client
17 }
18
19 type bucketOpts struct {
20 bucketName string
21 }
22
23
24
25 func WithBucket(bucket string) BucketOption {
26 return func(o *bucketOpts) {
27 o.bucketName = bucket
28 }
29 }
30
31
32 func WithClient(c *gcs.Client) Option {
33 return func(o *storageOpts) {
34 o.client = c
35 }
36 }
37
View as plain text