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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址