example

package
v0.0.0-...-0d2721a Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer struct {
	gosqs.Consumer
}

Consumer a wrapper for the gosqs consumer

func (*Consumer) CreatePost

func (c *Consumer) CreatePost(ctx context.Context, m gosqs.Message) error

CreatePost an example of what an event listener looks like

func (*Consumer) RegisterHandlers

func (c *Consumer) RegisterHandlers(adapters ...gosqs.Adapter)

RegisterHandlers listens to the specific event types from the queue

func (*Consumer) Test

func (c *Consumer) Test(ctx context.Context, m gosqs.Message) error

Test example event handler

type Post

type Post struct {
	ID     string `json:"id"`
	UserID string `json:"userId"`
	Body   string `json:"body"`
}

Post defines a message post

func (Post) ModelName

func (p Post) ModelName() string

ModelName satisfies the gosqs interface and allows messages to be sent out

this will look like Dispatcher(ctx).Create(&post{}) will send the message post_created

type ServiceHandler

type ServiceHandler struct{}

ServiceHandler example http handler

func (*ServiceHandler) Test

Test a showcase of various ways to send messages

Jump to

Keyboard shortcuts

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