broker

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: BSD-3-Clause Imports: 9 Imported by: 1

README

ginny-broker

broker provider for ginny

Documentation

Overview

Package broker provider kafka or other mq interface

Index

Constants

This section is empty.

Variables

BrokerProvider

Functions

func RegisterImplements

func RegisterImplements(scheme string, i mq)

RegisterImplements 注册实现类

Types

type Broker

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

Broker broker for message queue.

func NewBroker

func NewBroker(ctx context.Context, log *zap.Logger, conf *Config) (*Broker, error)

NewBroker

func (*Broker) Init

func (b *Broker) Init(ctx context.Context, log *zap.Logger, u *url.URL) error

Init 初始化

type Config

type Config struct {
	Dsn string
}

func NewConfiguration

func NewConfiguration(v *viper.Viper) (*Config, error)

NewConfiguration

type Handler

type Handler func(Publication) error

Handler is used to process messages via a subscription of a topic.

type Message

type Message struct {
	Header map[string]string
	Body   []byte
}

Message a message of common msq.

type Publication

type Publication interface {
	Message() *Message
	Ack() error
	Topic() string
}

Publication is given to a subscription handler for processing.

Directories

Path Synopsis
Package kafka provider kafka implement for broker
Package kafka provider kafka implement for broker

Jump to

Keyboard shortcuts

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