Пример #1
0
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),
	}
}
Пример #2
0
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),
	}
}
Пример #3
0
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),
	}
}
Пример #4
0
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(),
	}
}
Пример #5
0
func withNonIdempotentRetryCodes() gax.CallOption {
	return gax.WithRetryCodes([]codes.Code{})
}
Пример #6
0
func withIdempotentRetryCodes() gax.CallOption {
	return gax.WithRetryCodes([]codes.Code{
		codes.DeadlineExceeded,
		codes.Unavailable,
	})
}