queue

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWSSQSDefaultVisibilityTimeout = 30
)

Variables

View Source
var (
	ErrNoMessages = errors.New("no messages received")
	ErrNewQueue   = errors.New("error creating new queue instance")
	ErrConfig     = errors.New("queue configuration error")
	ErrReceiveMsg = errors.New("error when receiving message")
	ErrReturnMsg  = errors.New("error when returning message")
	ErrDeleteMsg  = errors.New("error when deleting message")
)
View Source
var (
	GcpPubSubDefaultAckDeadline = 60 * time.Second
)

Functions

This section is empty.

Types

type AwsSQSConfig

type AwsSQSConfig struct {
	Name              string `koanf:"name"`
	VisibilityTimeout int64  `koanf:"visibility_timeout"`
	Endpoint          string `koanf:"endpoint"`
	Region            string `koanf:"region"`
}

type AwsSQSMessage

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

func (AwsSQSMessage) Data

func (m AwsSQSMessage) Data() []byte

func (AwsSQSMessage) Id

func (m AwsSQSMessage) Id() string

func (AwsSQSMessage) QueueId

func (m AwsSQSMessage) QueueId() string

type AwsSQSQueue

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

func (*AwsSQSQueue) DeleteMessage

func (s *AwsSQSQueue) DeleteMessage(m Message) error

func (*AwsSQSQueue) QueueId

func (s *AwsSQSQueue) QueueId() string

func (*AwsSQSQueue) ReceiveMessage

func (s *AwsSQSQueue) ReceiveMessage() (Message, error)

func (*AwsSQSQueue) ReturnMessage

func (s *AwsSQSQueue) ReturnMessage(m Message) error

type GcpPubSubConfig

type GcpPubSubConfig struct {
	SubscriptionId     string `koanf:"subscription_id"`
	AckDeadlineSeconds int64  `koanf:"ack_deadline_seconds"`
	Endpoint           string `koanf:"endpoint"`
}

type GcpPubSubMessage

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

func (GcpPubSubMessage) Data

func (gm GcpPubSubMessage) Data() []byte

func (GcpPubSubMessage) Id

func (gm GcpPubSubMessage) Id() string

func (GcpPubSubMessage) QueueId

func (gm GcpPubSubMessage) QueueId() string

type GcpPubSubQueue

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

func (*GcpPubSubQueue) DeleteMessage

func (gq *GcpPubSubQueue) DeleteMessage(m Message) error

func (*GcpPubSubQueue) QueueId

func (gq *GcpPubSubQueue) QueueId() string

func (*GcpPubSubQueue) ReceiveMessage

func (gq *GcpPubSubQueue) ReceiveMessage() (Message, error)

func (*GcpPubSubQueue) ReturnMessage

func (gq *GcpPubSubQueue) ReturnMessage(m Message) error

type Message

type Message interface {
	Id() string
	QueueId() string
	Data() []byte
}

type Queue

type Queue interface {
	QueueId() string
	ReceiveMessage() (Message, error)
	DeleteMessage(m Message) error
	ReturnMessage(m Message) error
}

func New

func New(ctx context.Context, config any) (Queue, error)

func NewGcpPubSubQueue

func NewGcpPubSubQueue(ctx context.Context, config GcpPubSubConfig) (Queue, error)

func NewSQSQueue

func NewSQSQueue(ctx context.Context, config AwsSQSConfig) (Queue, error)

Jump to

Keyboard shortcuts

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