utils

package
v0.43.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcRequestTimeout added in v0.37.6

func CalcRequestTimeout(numDelivered int, ackWait time.Duration) time.Duration

func CalculateNakDelayForRetryNumber added in v0.37.6

func CalculateNakDelayForRetryNumber(attemptNum int, config *kncloudevents.RetryConfig) time.Duration

func ConsumerName

func ConsumerName(subUID string) string

func ConsumerSubjectName

func ConsumerSubjectName(namespace, name, uid string) string

ConsumerSubjectName generates a shareable subject name to bind to NATS Consumers for each Knative subscriber. This can be used by multiple dispatcher replicas to share delivery of

func ConvertDeliverPolicy

func ConvertDeliverPolicy(in v1alpha1.DeliverPolicy, def nats.DeliverPolicy) nats.DeliverPolicy

func ConvertDiscardPolicy

func ConvertDiscardPolicy(in v1alpha1.DiscardPolicy, def nats.DiscardPolicy) nats.DiscardPolicy

func ConvertJsDeliverPolicy added in v0.43.0

func ConvertJsDeliverPolicy(in v1alpha1.DeliverPolicy, def jetstream.DeliverPolicy) jetstream.DeliverPolicy

func ConvertJsReplayPolicy added in v0.43.0

func ConvertJsReplayPolicy(in v1alpha1.ReplayPolicy, def jetstream.ReplayPolicy) jetstream.ReplayPolicy

func ConvertPlacement

func ConvertPlacement(in *v1alpha1.StreamPlacement) *nats.Placement

func ConvertReplayPolicy

func ConvertReplayPolicy(in v1alpha1.ReplayPolicy, def nats.ReplayPolicy) nats.ReplayPolicy

func ConvertRetentionPolicy

func ConvertRetentionPolicy(in v1alpha1.RetentionPolicy, def nats.RetentionPolicy) nats.RetentionPolicy

func ConvertStorage

func ConvertStorage(in v1alpha1.Storage, def nats.StorageType) nats.StorageType

func ConvertStreamSource

func ConvertStreamSource(in *v1alpha1.StreamSource) *nats.StreamSource

func ConvertStreamSources

func ConvertStreamSources(in []v1alpha1.StreamSource) []*nats.StreamSource

func ExpBackoff added in v0.37.6

func ExpBackoff(attemptNum int, delayDuration time.Duration) time.Duration

func LinearBackoff added in v0.37.6

func LinearBackoff(attemptNum int, delayDuration time.Duration) time.Duration

func PublishSubjectName

func PublishSubjectName(namespace, name string) string

func StreamName

func StreamName(nc *v1alpha1.NatsJetStreamChannel) string

StreamName builds a valid NATS Jetstream stream name from a *v1alpha1.NatsJetStreamChannel. If overrideName is not set, the format is KN_NAMESPACE__NAME, where hyphens in the namespace or name are replaced with _.

For example: - "default/channel" => "KN_DEFAULT__CHANNEL" - "knative-eventing/my-channel" => "KN_KNATIVE_EVENTING__MY_CHANNEL"

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL