servicebus

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReceiverInterface

type ReceiverInterface interface {
	ReceiveMessage(ctx context.Context) ([]byte, error)
}

type SenderInterface

type SenderInterface interface {
	SendMessage(ctx context.Context, message []byte) error
}

type ServiceBus

type ServiceBus struct {
	// In the future, we can add more types of service bus here.
	Client *azservicebus.Client
}

func (*ServiceBus) NewServiceBusReceiver

func (sb *ServiceBus) NewServiceBusReceiver(ctx context.Context, topicOrQueue string, options *azservicebus.ReceiverOptions) (ReceiverInterface, error)

func (*ServiceBus) NewServiceBusSender

func (sb *ServiceBus) NewServiceBusSender(ctx context.Context, queue string, options *azservicebus.NewSenderOptions) (SenderInterface, error)

type ServiceBusClientInterface

type ServiceBusClientInterface interface {
	NewServiceBusReceiver(ctx context.Context, topicOrQueue string, options *azservicebus.ReceiverOptions) (ReceiverInterface, error)
	NewServiceBusSender(ctx context.Context, queue string, options *azservicebus.NewSenderOptions) (SenderInterface, error)
}

func CreateServiceBusClient

func CreateServiceBusClient(ctx context.Context, clientUrl string, credential azcore.TokenCredential, options *azservicebus.ClientOptions) (ServiceBusClientInterface, error)

func CreateServiceBusClientFromConnectionString

func CreateServiceBusClientFromConnectionString(ctx context.Context, connectionString string, options *azservicebus.ClientOptions) (ServiceBusClientInterface, error)

type ServiceBusReceiver

type ServiceBusReceiver struct {
	Receiver *azservicebus.Receiver
}

func (*ServiceBusReceiver) ReceiveMessage

func (r *ServiceBusReceiver) ReceiveMessage(ctx context.Context) ([]byte, error)

type ServiceBusSender

type ServiceBusSender struct {
	Sender *azservicebus.Sender
}

func (*ServiceBusSender) SendMessage

func (s *ServiceBusSender) SendMessage(ctx context.Context, message []byte) error

Jump to

Keyboard shortcuts

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