pkg

package
v1.0.44 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRetryableError

func IsRetryableError(err error) bool

func NewClient

func NewClient() (kubernetes.Interface, *rest.Config, error)

func NewClientWithConfig

func NewClientWithConfig(kubeConfig []byte) (kubernetes.Interface, *rest.Config, error)

func RunConsumer

func RunConsumer(rootCtx context.Context, config *v1.Config) error

func RunConsumerWithCallbacks

func RunConsumerWithCallbacks(rootCtx context.Context, config *v1.Config, callbacks *ConsumerCallbacks) error

Types

type Arn

type Arn struct {
	Partition string
	Service   string
	Region    string
	Account   string
	Resource  string
	Endpoint  string
}

func ParseArn

func ParseArn(s string) (Arn, error)

e.g. arn:aws:sqs:us-east-2:444455556666:queue1

func (Arn) ToQueueURL

func (arn Arn) ToQueueURL() string

e.g. const queueURL = "https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue"

type ConsumerCallbacks

type ConsumerCallbacks struct {
	OnMessageProcessed func()
	OnMessageFailed    func(err error)
	OnMessageRetried   func()
	OnConnectionChange func(state string)
}

type RetryCache

type RetryCache struct {
	// contains filtered or unexported fields
}

func NewRetryCache

func NewRetryCache() *RetryCache

func (*RetryCache) GetBackoff

func (rc *RetryCache) GetBackoff(ctx context.Context, messageID string, retry *v1.Retry) *time.Duration

func (*RetryCache) Remove

func (rc *RetryCache) Remove(ctx context.Context, messageID string)

type RetryItem

type RetryItem struct {
	LastAttempt time.Time
	Count       int
}

Directories

Path Synopsis
apis
batch/v1
Package v1 contains API Schema definitions for the batch v1 API group +kubebuilder:object:generate=true +groupName=batch.flanksource.com
Package v1 contains API Schema definitions for the batch v1 API group +kubebuilder:object:generate=true +groupName=batch.flanksource.com

Jump to

Keyboard shortcuts

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