pubsub

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Overview

Package pubsub provides a foundation for implementing pub/sub clients for various message brokers such as google pub-sub, kafka and MQTT. It defines interfaces for publishing and subscribing to messages, managing topics, and handling messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Publisher
	Subscriber
	Health() datasource.Health

	CreateTopic(context context.Context, name string) error
	DeleteTopic(context context.Context, name string) error
}

type Committer

type Committer interface {
	Commit()
}

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Debug(args ...interface{})
	Logf(format string, args ...interface{})
	Log(args ...interface{})
	Errorf(format string, args ...interface{})
	Error(args ...interface{})
}

type Message

type Message struct {
	Topic    string
	Value    []byte
	MetaData interface{}

	Committer
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(ctx context.Context) *Message

func (*Message) Bind

func (m *Message) Bind(i interface{}) error

func (*Message) Context

func (m *Message) Context() context.Context

func (*Message) HostName

func (m *Message) HostName() string

func (*Message) Param

func (m *Message) Param(p string) string

func (*Message) PathParam

func (m *Message) PathParam(p string) string

type Publisher

type Publisher interface {
	Publish(ctx context.Context, topic string, message []byte) error
}

type Subscriber

type Subscriber interface {
	Subscribe(ctx context.Context, topic string) (*Message, error)
}

Directories

Path Synopsis
eventhub module
Package google provides a client for interacting with Google Cloud Pub/Sub.This package facilitates interaction with Google Cloud Pub/Sub, allowing publishing and subscribing to topics, managing subscriptions, and handling messages.
Package google provides a client for interacting with Google Cloud Pub/Sub.This package facilitates interaction with Google Cloud Pub/Sub, allowing publishing and subscribing to topics, managing subscriptions, and handling messages.
Package kafka provides a client for interacting with Apache Kafka message queues.This package facilitates interaction with Apache Kafka, allowing publishing and subscribing to topics, managing consumer groups, and handling messages.
Package kafka provides a client for interacting with Apache Kafka message queues.This package facilitates interaction with Apache Kafka, allowing publishing and subscribing to topics, managing consumer groups, and handling messages.
Package mqtt provides a client for interacting with MQTT message brokers.This package facilitates interaction with MQTT brokers, allowing publishing and subscribing to topics, managing subscriptions, and handling messages.
Package mqtt provides a client for interacting with MQTT message brokers.This package facilitates interaction with MQTT brokers, allowing publishing and subscribing to topics, managing subscriptions, and handling messages.
nats module

Jump to

Keyboard shortcuts

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