Documentation ¶
Index ¶
- Constants
- func LogDebug(args ...interface{})
- func LogDebugf(format string, args ...interface{})
- func LogError(args ...interface{})
- func LogErrorf(format string, args ...interface{})
- func LogFatal(args ...interface{})
- func LogFatalf(format string, args ...interface{})
- func LogInfo(args ...interface{})
- func LogInfof(format string, args ...interface{})
- func LogWarn(args ...interface{})
- func LogWarnf(format string, args ...interface{})
- func RegisterSubscriber[T any](srv *Server, ctx context.Context, topic, queue string, disableAutoAck bool, ...) error
- type Server
- type ServerOption
- func WithAddress(addrs []string) ServerOption
- func WithBrokerOptions(opts ...broker.Option) ServerOption
- func WithCodec(c string) ServerOption
- func WithEnableKeepAlive(enable bool) ServerOption
- func WithGlobalPropagator() ServerOption
- func WithGlobalTracerProvider() ServerOption
- func WithMiddleware(m ...broker.MiddlewareFunc) ServerOption
- func WithPlainMechanism(username, password string) ServerOption
- func WithPropagator(propagators propagation.TextMapPropagator) ServerOption
- func WithScramMechanism(algo string, username, password string) ServerOption
- func WithTLSConfig(c *tls.Config) ServerOption
- func WithTracerProvider(provider trace.TracerProvider, tracerName string) ServerOption
- type Transport
- func (tr *Transport) Endpoint() string
- func (tr *Transport) Kind() kratosTransport.Kind
- func (tr *Transport) NodeFilters() []selector.NodeFilter
- func (tr *Transport) Operation() string
- func (tr *Transport) ReplyHeader() kratosTransport.Header
- func (tr *Transport) RequestHeader() kratosTransport.Header
Constants ¶
View Source
const (
KindKafka kratosTransport.Kind = "kafka"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
func (*Server) RegisterSubscriber ¶
func (s *Server) RegisterSubscriber(ctx context.Context, topic, queue string, disableAutoAck bool, handler broker.Handler, binder broker.Binder, opts ...broker.SubscribeOption) error
RegisterSubscriber 注册一个订阅者 @param ctx 上下文 @param topic 订阅的主题 @param queue 订阅的分组 @param handler 订阅者的处理函数
type ServerOption ¶
type ServerOption func(o *Server)
func WithBrokerOptions ¶
func WithBrokerOptions(opts ...broker.Option) ServerOption
WithBrokerOptions MQ代理配置
func WithEnableKeepAlive ¶
func WithEnableKeepAlive(enable bool) ServerOption
WithEnableKeepAlive enable keep alive
func WithGlobalPropagator ¶
func WithGlobalPropagator() ServerOption
WithGlobalPropagator 注入全局的链路追踪器的Propagator
func WithGlobalTracerProvider ¶
func WithGlobalTracerProvider() ServerOption
WithGlobalTracerProvider 注入全局的链路追踪器的Provider
func WithMiddleware ¶
func WithMiddleware(m ...broker.MiddlewareFunc) ServerOption
WithMiddleware 注入中间件
func WithPlainMechanism ¶
func WithPlainMechanism(username, password string) ServerOption
WithPlainMechanism PLAIN认证信息
func WithPropagator ¶
func WithPropagator(propagators propagation.TextMapPropagator) ServerOption
WithPropagator 注入链路追踪器的Propagator
func WithScramMechanism ¶
func WithScramMechanism(algo string, username, password string) ServerOption
WithScramMechanism SCRAM认证信息
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider, tracerName string) ServerOption
WithTracerProvider 注入链路追踪器的Provider
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a Kafka transport.
func (*Transport) Kind ¶
func (tr *Transport) Kind() kratosTransport.Kind
Kind returns the transport kind.
func (*Transport) NodeFilters ¶
func (tr *Transport) NodeFilters() []selector.NodeFilter
NodeFilters returns the client select filters.
func (*Transport) ReplyHeader ¶
func (tr *Transport) ReplyHeader() kratosTransport.Header
ReplyHeader returns the reply header.
func (*Transport) RequestHeader ¶
func (tr *Transport) RequestHeader() kratosTransport.Header
RequestHeader returns the request header.
Click to show internal directories.
Click to hide internal directories.