mirror of
https://github.com/restic/restic.git
synced 2026-06-21 16:14:18 +00:00
Update dependencies
Among others, this updates minio-go, so that the new "eu-west-3" zone for AWS is supported.
This commit is contained in:
+88
@@ -279,3 +279,91 @@ func ExampleSubscription_Update() {
|
||||
}
|
||||
_ = subConfig // TODO: Use SubscriptionConfig.
|
||||
}
|
||||
|
||||
func ExampleSubscription_CreateSnapshot() {
|
||||
ctx := context.Background()
|
||||
client, err := pubsub.NewClient(ctx, "project-id")
|
||||
if err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
sub := client.Subscription("subName")
|
||||
snapConfig, err := sub.CreateSnapshot(ctx, "snapshotName")
|
||||
if err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
_ = snapConfig // TODO: Use SnapshotConfig.
|
||||
}
|
||||
|
||||
func ExampleSubscription_SeekToSnapshot() {
|
||||
ctx := context.Background()
|
||||
client, err := pubsub.NewClient(ctx, "project-id")
|
||||
if err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
sub := client.Subscription("subName")
|
||||
snap := client.Snapshot("snapshotName")
|
||||
if err := sub.SeekToSnapshot(ctx, snap); err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleSubscription_SeekToTime() {
|
||||
ctx := context.Background()
|
||||
client, err := pubsub.NewClient(ctx, "project-id")
|
||||
if err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
sub := client.Subscription("subName")
|
||||
if err := sub.SeekToTime(ctx, time.Now().Add(-time.Hour)); err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleSnapshot_Delete() {
|
||||
ctx := context.Background()
|
||||
client, err := pubsub.NewClient(ctx, "project-id")
|
||||
if err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
|
||||
snap := client.Snapshot("snapshotName")
|
||||
if err := snap.Delete(ctx); err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleClient_Snapshots() {
|
||||
ctx := context.Background()
|
||||
client, err := pubsub.NewClient(ctx, "project-id")
|
||||
if err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
// List all snapshots for the project.
|
||||
iter := client.Snapshots(ctx)
|
||||
_ = iter // TODO: iterate using Next.
|
||||
}
|
||||
|
||||
func ExampleSnapshotConfigIterator_Next() {
|
||||
ctx := context.Background()
|
||||
client, err := pubsub.NewClient(ctx, "project-id")
|
||||
if err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
// List all snapshots for the project.
|
||||
iter := client.Snapshots(ctx)
|
||||
for {
|
||||
snapConfig, err := iter.Next()
|
||||
if err == iterator.Done {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
_ = snapConfig // TODO: use the SnapshotConfig.
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(jba): write an example for PublishResult.Ready
|
||||
// TODO(jba): write an example for Subscription.IAM
|
||||
// TODO(jba): write an example for Topic.IAM
|
||||
// TODO(jba): write an example for Topic.Stop
|
||||
|
||||
Reference in New Issue
Block a user