本文整理汇总了Golang中github.com/googleapis/gax-go.WithRetry函数的典型用法代码示例。如果您正苦于以下问题:Golang WithRetry函数的具体用法?Golang WithRetry怎么用?Golang WithRetry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WithRetry函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: defaultCallOptions
func defaultCallOptions() *CallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 1000 * time.Millisecond,
Multiplier: 1.2,
})
}),
},
{"list", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 1000 * time.Millisecond,
Multiplier: 1.2,
})
}),
},
}
return &CallOptions{
DeleteLog: retry[[2]string{"default", "idempotent"}],
WriteLogEntries: retry[[2]string{"default", "non_idempotent"}],
ListLogEntries: retry[[2]string{"list", "idempotent"}],
ListMonitoredResourceDescriptors: retry[[2]string{"default", "idempotent"}],
}
}
开发者ID:rawlingsj,项目名称:gofabric8,代码行数:35,代码来源:logging_client.go
示例2: defaultIamCallOptions
func defaultIamCallOptions() *IamCallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.3,
})
}),
},
}
return &IamCallOptions{
ListServiceAccounts: retry[[2]string{"default", "idempotent"}],
GetServiceAccount: retry[[2]string{"default", "idempotent"}],
CreateServiceAccount: retry[[2]string{"default", "non_idempotent"}],
UpdateServiceAccount: retry[[2]string{"default", "idempotent"}],
DeleteServiceAccount: retry[[2]string{"default", "idempotent"}],
ListServiceAccountKeys: retry[[2]string{"default", "idempotent"}],
GetServiceAccountKey: retry[[2]string{"default", "idempotent"}],
CreateServiceAccountKey: retry[[2]string{"default", "non_idempotent"}],
DeleteServiceAccountKey: retry[[2]string{"default", "idempotent"}],
SignBlob: retry[[2]string{"default", "non_idempotent"}],
GetIamPolicy: retry[[2]string{"default", "non_idempotent"}],
SetIamPolicy: retry[[2]string{"default", "non_idempotent"}],
TestIamPermissions: retry[[2]string{"default", "non_idempotent"}],
QueryGrantableRoles: retry[[2]string{"default", "non_idempotent"}],
}
}
开发者ID:trythings,项目名称:trythings,代码行数:32,代码来源:iam_client.go
示例3: defaultSubscriberCallOptions
func defaultSubscriberCallOptions() *SubscriberCallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.3,
})
}),
},
}
return &SubscriberCallOptions{
CreateSubscription: retry[[2]string{"default", "idempotent"}],
GetSubscription: retry[[2]string{"default", "idempotent"}],
ListSubscriptions: retry[[2]string{"default", "idempotent"}],
DeleteSubscription: retry[[2]string{"default", "idempotent"}],
ModifyAckDeadline: retry[[2]string{"default", "non_idempotent"}],
Acknowledge: retry[[2]string{"messaging", "non_idempotent"}],
Pull: retry[[2]string{"messaging", "non_idempotent"}],
StreamingPull: retry[[2]string{"messaging", "non_idempotent"}],
ModifyPushConfig: retry[[2]string{"default", "non_idempotent"}],
}
}
开发者ID:GoogleCloudPlatform,项目名称:gcloud-golang,代码行数:27,代码来源:subscriber_client.go
示例4: defaultMetricCallOptions
func defaultMetricCallOptions() *MetricCallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.3,
})
}),
},
}
return &MetricCallOptions{
ListMonitoredResourceDescriptors: retry[[2]string{"default", "idempotent"}],
GetMonitoredResourceDescriptor: retry[[2]string{"default", "idempotent"}],
ListMetricDescriptors: retry[[2]string{"default", "idempotent"}],
GetMetricDescriptor: retry[[2]string{"default", "idempotent"}],
CreateMetricDescriptor: retry[[2]string{"default", "non_idempotent"}],
DeleteMetricDescriptor: retry[[2]string{"default", "idempotent"}],
ListTimeSeries: retry[[2]string{"default", "idempotent"}],
CreateTimeSeries: retry[[2]string{"default", "non_idempotent"}],
}
}
开发者ID:trythings,项目名称:trythings,代码行数:26,代码来源:metric_client.go
示例5: defaultPublisherCallOptions
func defaultPublisherCallOptions() *PublisherCallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.3,
})
}),
},
{"messaging", "one_plus_delivery"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.3,
})
}),
},
}
return &PublisherCallOptions{
CreateTopic: retry[[2]string{"default", "idempotent"}],
Publish: retry[[2]string{"messaging", "one_plus_delivery"}],
GetTopic: retry[[2]string{"default", "idempotent"}],
ListTopics: retry[[2]string{"default", "idempotent"}],
ListTopicSubscriptions: retry[[2]string{"default", "idempotent"}],
DeleteTopic: retry[[2]string{"default", "idempotent"}],
}
}
开发者ID:rawlingsj,项目名称:gofabric8,代码行数:37,代码来源:publisher_client.go
示例6: defaultImageAnnotatorCallOptions
func defaultImageAnnotatorCallOptions() *ImageAnnotatorCallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.3,
})
}),
},
}
return &ImageAnnotatorCallOptions{
BatchAnnotateImages: retry[[2]string{"default", "idempotent"}],
}
}
开发者ID:trythings,项目名称:trythings,代码行数:19,代码来源:image_annotator_client.go
示例7: defaultController2CallOptions
func defaultController2CallOptions() *Controller2CallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.3,
})
}),
},
}
return &Controller2CallOptions{
RegisterDebuggee: retry[[2]string{"default", "non_idempotent"}],
ListActiveBreakpoints: retry[[2]string{"default", "idempotent"}],
UpdateActiveBreakpoint: retry[[2]string{"default", "idempotent"}],
}
}
开发者ID:trythings,项目名称:trythings,代码行数:21,代码来源:controller2_client.go
示例8: defaultCallOptions
func defaultCallOptions() *CallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.3,
})
}),
},
}
return &CallOptions{
SyncRecognize: retry[[2]string{"default", "idempotent"}],
AsyncRecognize: retry[[2]string{"default", "idempotent"}],
StreamingRecognize: retry[[2]string{"default", "non_idempotent"}],
}
}
开发者ID:trythings,项目名称:trythings,代码行数:21,代码来源:speech_client.go
示例9: defaultErrorStatsCallOptions
func defaultErrorStatsCallOptions() *ErrorStatsCallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.3,
})
}),
},
}
return &ErrorStatsCallOptions{
ListGroupStats: retry[[2]string{"default", "idempotent"}],
ListEvents: retry[[2]string{"default", "idempotent"}],
DeleteEvents: retry[[2]string{"default", "idempotent"}],
}
}
开发者ID:trythings,项目名称:trythings,代码行数:21,代码来源:error_stats_client.go
示例10: defaultCallOptions
func defaultCallOptions() *CallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 1000 * time.Millisecond,
Multiplier: 1.2,
})
}),
},
}
return &CallOptions{
PatchTraces: retry[[2]string{"default", "idempotent"}],
GetTrace: retry[[2]string{"default", "idempotent"}],
ListTraces: retry[[2]string{"default", "idempotent"}],
}
}
开发者ID:trythings,项目名称:trythings,代码行数:21,代码来源:trace_client.go
示例11: defaultCallOptions
func defaultCallOptions() *CallOptions {
retry := map[[2]string][]gax.CallOption{
{"default", "idempotent"}: {
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
}, gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.3,
})
}),
},
}
return &CallOptions{
AnalyzeSentiment: retry[[2]string{"default", "idempotent"}],
AnalyzeEntities: retry[[2]string{"default", "idempotent"}],
AnalyzeSyntax: retry[[2]string{"default", "idempotent"}],
AnnotateText: retry[[2]string{"default", "idempotent"}],
}
}
开发者ID:trythings,项目名称:trythings,代码行数:22,代码来源:language_client.go
注:本文中的github.com/googleapis/gax-go.WithRetry函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论