sqslink

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const RawMessageName = "/o5.messaging.v1.topic.RawMessageTopic/Raw"

Variables

This section is empty.

Functions

This section is empty.

Types

type DeadLetterHandler added in v0.0.2

type DeadLetterHandler interface {
	DeadLetter(context.Context, *dante_tpb.DeadMessage) error
}

type Endpoint

type Endpoint interface {
	RoundTrip(ctx context.Context, serviceName string, protoMessage []byte) error
}

type Handler added in v0.0.2

type Handler interface {
	HandleMessage(context.Context, *Message) error
}

type Invoker

type Invoker interface {
	Invoke(context.Context, string, interface{}, interface{}, ...grpc.CallOption) error
}

type Message added in v0.0.2

type Message struct {
	Proto        proto.Message
	ServiceName  string
	SQSMessageID string
	MessageID    string
}

type SNSMessageWrapper added in v0.0.6

type SNSMessageWrapper struct {
	Type      string `json:"Type"`
	Message   []byte `json:"Message"`
	MessageID string `json:"MessageId"`
	TopicArn  string `json:"TopicArn"`
}

type SQSAPI

type SQSAPI interface {
	ReceiveMessage(ctx context.Context, input *sqs.ReceiveMessageInput, opts ...func(*sqs.Options)) (*sqs.ReceiveMessageOutput, error)
	DeleteMessage(ctx context.Context, input *sqs.DeleteMessageInput, opts ...func(*sqs.Options)) (*sqs.DeleteMessageOutput, error)
}

type Worker

type Worker struct {
	SQSClient SQSAPI
	QueueURL  string
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(sqs SQSAPI, queueURL string, deadLetters DeadLetterHandler) *Worker

func (*Worker) RegisterService

func (ww *Worker) RegisterService(ctx context.Context, service protoreflect.ServiceDescriptor, invoker Invoker) error

func (*Worker) Run

func (ww *Worker) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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