appevents

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 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 AppEventHandler

type AppEventHandler func(payload []byte, event string)

type Dispatcher

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

func (*Dispatcher) Bootstrap

func (d *Dispatcher) Bootstrap(topicId string) error

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch(event string, message Message) error

type Listener

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

func (*Listener) Bootstrap added in v0.2.7

func (l *Listener) Bootstrap(projectID string, topicID string, subID string) error

func (*Listener) Listen

func (l *Listener) Listen() error

func (*Listener) RegisterHandlers

func (l *Listener) RegisterHandlers(handlers map[string]AppEventHandler)

type Message

type Message interface {
	proto.Message
	// StringType should return a string representation of this
	// protobuf message, which will be used when sending app
	// events through this package.
	StringType() string
}

type ProtoBody

type ProtoBody struct {
	Payload []byte `json:"payload"`
	Proto   string `json:"proto"`
}

func (*ProtoBody) FromPubsubMessage

func (p *ProtoBody) FromPubsubMessage(message *pubsub.Message) error

type Topic

type Topic interface {
	Send(ctx context.Context, message *pubsub.Message) error
}

Jump to

Keyboard shortcuts

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