Documentation
¶
Index ¶
- Variables
- func Close() error
- func Init(ctx context.Context, b string, d *sql.DB) error
- func Publish(ctx context.Context, topic string, payload any, opts ...PublishOption) error
- func Start(ctx context.Context) error
- func Subscribe(topic string, handler func(ctx context.Context, msg []byte) error)
- type PublishOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotInitialized = errors.New("queue: not initialized, call Init first") ErrUnknownBackend = errors.New("queue: unknown backend") )
Functions ¶
func Init ¶
Init initializes the queue with the given backend ("postgres" or "memory"). For "postgres", db must be non-nil; the fullend_queue table is auto-created.
Types ¶
type PublishOption ¶
type PublishOption func(*publishConfig)
PublishOption configures a Publish call.
func WithDelay ¶
func WithDelay(seconds int) PublishOption
WithDelay sets the delivery delay in seconds.
func WithPriority ¶
func WithPriority(p string) PublishOption
WithPriority sets the message priority ("high", "normal", "low").
Click to show internal directories.
Click to hide internal directories.