Exemplo n.º 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),
	}
}
Exemplo n.º 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),
	}
}
Exemplo n.º 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),
	}
}
Exemplo n.º 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(),
	}
}
Exemplo n.º 5
0
func withNonIdempotentRetryCodes() gax.CallOption {
	return gax.WithRetryCodes([]codes.Code{})
}
Exemplo n.º 6
0
func withIdempotentRetryCodes() gax.CallOption {
	return gax.WithRetryCodes([]codes.Code{
		codes.DeadlineExceeded,
		codes.Unavailable,
	})
}