mq

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback interface {
	// Finish finish the message
	Finish(ctx context.Context) error
	// Delay make the message visible again after interval
	Delay(ctx context.Context, duration time.Duration) error
}

type Pub

type Pub interface {
	Publish(ctx context.Context, msg string, opt *PublishOption) error
}

type PubSub

type PubSub interface {
	Pub
	Sub
}

type PublishOption

type PublishOption struct {
	GroupID   string
	TraceID   string
	VisibleAt time.Time
	ExpiredAt time.Time
}

type ReceiveOption

type ReceiveOption struct {
	VisibilityTimeout time.Duration
}

type Sub

type Sub interface {
	Receive(ctx context.Context, opt *ReceiveOption) (string, Callback, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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