kafka

package
v0.0.0-...-2d343b4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindKafka transport.Kind = "kafka"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	broker.Broker

	sync.RWMutex
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opts ...ServerOption) *Server

func (*Server) Endpoint

func (s *Server) Endpoint() (*url.URL, error)

func (*Server) Name

func (s *Server) Name() string

func (*Server) RegisterSubscriber

func (s *Server) RegisterSubscriber(ctx context.Context, topic, queue string, disableAutoAck bool, h broker.Handler, opts ...broker.SubscribeOption) error

RegisterSubscriber 注册一个订阅者 @param ctx 上下文 @param topic 订阅的主题 @param queue 订阅的分组 @param handler 订阅者的处理函数

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop(_ context.Context) error

type ServerOption

type ServerOption func(o *Server)

func Address

func Address(addrs []string) ServerOption

func Logger

func Logger(logger log.Logger) ServerOption

func Subscribe

func Subscribe(ctx context.Context, topic, queue string, disableAutoAck bool, h broker.Handler, opts ...broker.SubscribeOption) ServerOption

func TLSConfig

func TLSConfig(c *tls.Config) ServerOption

type SubscribeOption

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

type SubscribeOptionMap

type SubscribeOptionMap map[string]*SubscribeOption

type SubscriberMap

type SubscriberMap map[string]broker.Subscriber

type Transport

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

Transport is a Kafka transport.

func (*Transport) Endpoint

func (tr *Transport) Endpoint() string

Endpoint returns the transport endpoint.

func (*Transport) Kind

func (tr *Transport) Kind() transport.Kind

Kind returns the transport kind.

func (*Transport) Operation

func (tr *Transport) Operation() string

Operation returns the transport operation.

func (*Transport) ReplyHeader

func (tr *Transport) ReplyHeader() transport.Header

ReplyHeader returns the reply header.

func (*Transport) RequestHeader

func (tr *Transport) RequestHeader() transport.Header

RequestHeader returns the request header.

func (*Transport) SelectFilters

func (tr *Transport) SelectFilters() []selector.Filter

SelectFilters returns the client select filters.

Jump to

Keyboard shortcuts

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