mirror of
https://github.com/restic/restic.git
synced 2026-11-22 21:34:25 +00:00
Update vendored library cloud.google.com/go
This commit is contained in:
1 parent
a4ff591165
commit
a951e7b126
221 files changed
+19911
-2075
No files matched your search
+19
@@ -196,6 +196,25 @@ func ExampleBucketHandle_AddNotification() {
|
||||
fmt.Println(n.ID)
|
||||
}
|
||||
|
||||
func ExampleBucketHandle_LockRetentionPolicy() {
|
||||
ctx := context.Background()
|
||||
client, err := storage.NewClient(ctx)
|
||||
if err != nil {
|
||||
// TODO: handle error.
|
||||
}
|
||||
b := client.Bucket("my-bucket")
|
||||
attrs, err := b.Attrs(ctx)
|
||||
if err != nil {
|
||||
// TODO: handle error.
|
||||
}
|
||||
// Note that locking the bucket without first attaching a RetentionPolicy
|
||||
// that's at least 1 day is a no-op
|
||||
err = b.If(storage.BucketConditions{MetagenerationMatch: attrs.MetaGeneration}).LockRetentionPolicy(ctx)
|
||||
if err != nil {
|
||||
// TODO: handle err
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleBucketHandle_Notifications() {
|
||||
ctx := context.Background()
|
||||
client, err := storage.NewClient(ctx)
|
||||
|
||||
Reference in new issue
Block a user