pubsub

package
v0.1.4 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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Subscribe

func Subscribe(ctx context.Context, c QueueConfig) (*pubsub.Subscription, error)

Types

type Arn

type Arn struct {
	Partition string
	Service   string
	Region    string
	Account   string
	Resource  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 KafkaConfig

type KafkaConfig struct {
	Brokers []string `json:"brokers"`
	Topic   string   `json:"topic"`
	Group   string   `json:"group"`
}

+kubebuilder:object:generate=true

func (*KafkaConfig) DeepCopy

func (in *KafkaConfig) DeepCopy() *KafkaConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaConfig.

func (*KafkaConfig) DeepCopyInto

func (in *KafkaConfig) DeepCopyInto(out *KafkaConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (KafkaConfig) String

func (k KafkaConfig) String() string

type MemoryConfig

type MemoryConfig struct {
	QueueName string `json:"queue"`
}

+kubebuilder:object:generate=true

func (*MemoryConfig) DeepCopy

func (in *MemoryConfig) DeepCopy() *MemoryConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemoryConfig.

func (*MemoryConfig) DeepCopyInto

func (in *MemoryConfig) DeepCopyInto(out *MemoryConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (MemoryConfig) String

func (m MemoryConfig) String() string

type NATSConfig

type NATSConfig struct {
	URL     string `json:"url,omitempty"`
	Subject string `json:"subject"`
	Queue   string `json:"queue,omitempty"`
}

+kubebuilder:object:generate=true

func (*NATSConfig) DeepCopy

func (in *NATSConfig) DeepCopy() *NATSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSConfig.

func (*NATSConfig) DeepCopyInto

func (in *NATSConfig) DeepCopyInto(out *NATSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (NATSConfig) String

func (n NATSConfig) String() string

type PubSubConfig

type PubSubConfig struct {
	ProjectID                string `json:"project_id"`
	Subscription             string `json:"subscription"`
	connection.GCPConnection `json:",inline"`
}

+kubebuilder:object:generate=true

func (*PubSubConfig) DeepCopy

func (in *PubSubConfig) DeepCopy() *PubSubConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PubSubConfig.

func (*PubSubConfig) DeepCopyInto

func (in *PubSubConfig) DeepCopyInto(out *PubSubConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (PubSubConfig) String

func (p PubSubConfig) String() string

type QueueConfig

type QueueConfig struct {
	SQS      *SQSConfig    `json:"sqs,omitempty"`
	PubSub   *PubSubConfig `json:"pubsub,omitempty"`
	RabbitMQ *RabbitConfig `json:"rabbitmq,omitempty"`
	Memory   *MemoryConfig `json:"memory,omitempty"`
	Kafka    *KafkaConfig  `json:"kafka,omitempty"`
	NATS     *NATSConfig   `json:"nats,omitempty"`
}

+kubebuilder:object:generate=true

func (*QueueConfig) DeepCopy

func (in *QueueConfig) DeepCopy() *QueueConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueueConfig.

func (*QueueConfig) DeepCopyInto

func (in *QueueConfig) DeepCopyInto(out *QueueConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (QueueConfig) GetQueue

func (c QueueConfig) GetQueue() fmt.Stringer

type RabbitConfig

type RabbitConfig struct {
	URL   `json:",inline"`
	Queue string `json:"queue"`
}

+kubebuilder:object:generate=true

func (*RabbitConfig) DeepCopy

func (in *RabbitConfig) DeepCopy() *RabbitConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RabbitConfig.

func (*RabbitConfig) DeepCopyInto

func (in *RabbitConfig) DeepCopyInto(out *RabbitConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (RabbitConfig) String

func (r RabbitConfig) String() string

type SQSConfig

type SQSConfig struct {
	QueueArn    string `json:"queue"`
	RawDelivery bool   `json:"raw"`
	// Time in seconds to long-poll for messages, Default to 15, max is 20
	WaitTime                 int `json:"waitTime,omitempty"`
	connection.AWSConnection `json:",inline"`
}

+kubebuilder:object:generate=true

func (*SQSConfig) DeepCopy

func (in *SQSConfig) DeepCopy() *SQSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SQSConfig.

func (*SQSConfig) DeepCopyInto

func (in *SQSConfig) DeepCopyInto(out *SQSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (SQSConfig) String

func (s SQSConfig) String() string

type URL

type URL struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
}

+kubebuilder:object:generate=true

func (*URL) DeepCopy

func (in *URL) DeepCopy() *URL

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new URL.

func (*URL) DeepCopyInto

func (in *URL) DeepCopyInto(out *URL)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (URL) String

func (u URL) String() string

Jump to

Keyboard shortcuts

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