func defaultPublisherCallOptions() *PublisherCallOptions { withIdempotentRetryCodes := gax.WithRetryCodes([]codes.Code{ codes.DeadlineExceeded, codes.Unavailable, }, ) withOnePlusDeliveryRetryCodes := gax.WithRetryCodes([]codes.Code{ codes.DeadlineExceeded, codes.Unavailable, }, ) return &PublisherCallOptions{ CreateTopic: append(defaultPublisherRetryOptions(), withIdempotentRetryCodes), Publish: append(messagingPublisherRetryOptions(), withOnePlusDeliveryRetryCodes), GetTopic: append(defaultPublisherRetryOptions(), withIdempotentRetryCodes), ListTopics: append(defaultPublisherRetryOptions(), withIdempotentRetryCodes), ListTopicSubscriptions: append(defaultPublisherRetryOptions(), withIdempotentRetryCodes), DeleteTopic: append(defaultPublisherRetryOptions(), withIdempotentRetryCodes), } }
func defaultMetricsCallOptions() *MetricsCallOptions { withIdempotentRetryCodes := gax.WithRetryCodes([]codes.Code{ codes.DeadlineExceeded, codes.Unavailable, }) return &MetricsCallOptions{ ListLogMetrics: append(defaultMetricsRetryOptions(), withIdempotentRetryCodes), GetLogMetric: append(defaultMetricsRetryOptions(), withIdempotentRetryCodes), CreateLogMetric: defaultMetricsRetryOptions(), UpdateLogMetric: defaultMetricsRetryOptions(), DeleteLogMetric: append(defaultMetricsRetryOptions(), withIdempotentRetryCodes), } }
func defaultConfigCallOptions() *ConfigCallOptions { withIdempotentRetryCodes := gax.WithRetryCodes([]codes.Code{ codes.DeadlineExceeded, codes.Unavailable, }) return &ConfigCallOptions{ ListSinks: append(defaultConfigRetryOptions(), withIdempotentRetryCodes), GetSink: append(defaultConfigRetryOptions(), withIdempotentRetryCodes), CreateSink: defaultConfigRetryOptions(), UpdateSink: defaultConfigRetryOptions(), DeleteSink: append(defaultConfigRetryOptions(), withIdempotentRetryCodes), } }
func defaultSubscriberCallOptions() *SubscriberCallOptions { withIdempotentRetryCodes := gax.WithRetryCodes([]codes.Code{ codes.DeadlineExceeded, codes.Unavailable, }, ) return &SubscriberCallOptions{ CreateSubscription: append(defaultSubscriberRetryOptions(), withIdempotentRetryCodes), GetSubscription: append(defaultSubscriberRetryOptions(), withIdempotentRetryCodes), ListSubscriptions: append(defaultSubscriberRetryOptions(), withIdempotentRetryCodes), DeleteSubscription: append(defaultSubscriberRetryOptions(), withIdempotentRetryCodes), ModifyAckDeadline: defaultSubscriberRetryOptions(), Acknowledge: messagingSubscriberRetryOptions(), Pull: messagingSubscriberRetryOptions(), ModifyPushConfig: defaultSubscriberRetryOptions(), } }
func withNonIdempotentRetryCodes() gax.CallOption { return gax.WithRetryCodes([]codes.Code{}) }
func withIdempotentRetryCodes() gax.CallOption { return gax.WithRetryCodes([]codes.Code{ codes.DeadlineExceeded, codes.Unavailable, }) }