Documentation
¶
Index ¶
- Constants
- func ExampleUsage()
- func NewMsgBus(options ...IMsgBusOption) (xmsgbus.IMsgBus, error)
- func NewStorage(brokers []string, options ...IMsgBusOption) (xmsgbus.ISharedStorage, error)
- func ProductionConfig() xmsgbus.IMsgBus
- type Consumer
- type IMsgBusOption
- type MsgBus
- func (x *MsgBus) AddChannel(ctx context.Context, topic string, channel string) error
- func (x *MsgBus) Close() error
- func (x *MsgBus) ListChannel(ctx context.Context, topic string) ([]string, error)
- func (x *MsgBus) Pop(ctx context.Context, topic, channel string, blockTimeout time.Duration) ([]byte, func(), error)
- func (x *MsgBus) Push(ctx context.Context, topic string, bs []byte) error
- func (x *MsgBus) RemoveChannel(ctx context.Context, topic string, channel string) error
- type MsgBusOptionFunc
- func WithBrokers(brokers []string) MsgBusOptionFunc
- func WithGroupPrefix(prefix string) MsgBusOptionFunc
- func WithInsecureTLS() MsgBusOptionFunc
- func WithSASLPlainAuth(username, password string) MsgBusOptionFunc
- func WithSASLSCRAMSHA256Auth(username, password string) MsgBusOptionFunc
- func WithSASLSCRAMSHA512Auth(username, password string) MsgBusOptionFunc
- func WithSaramaConfig(config *sarama.Config) MsgBusOptionFunc
- func WithSessionTimeout(timeout time.Duration) MsgBusOptionFunc
- func WithTLS(tlsConfig *tls.Config) MsgBusOptionFunc
- type Storage
Constants ¶
View Source
const ( DefaultSessionTimeout = 10 * time.Second DefaultGroupPrefix = "xmsgbus" )
Variables ¶
This section is empty.
Functions ¶
func ExampleUsage ¶
func ExampleUsage()
ExampleUsage demonstrates how to use SASL authentication with Kafka
func NewStorage ¶
func NewStorage(brokers []string, options ...IMsgBusOption) (xmsgbus.ISharedStorage, error)
Types ¶
type IMsgBusOption ¶
type IMsgBusOption interface {
// contains filtered or unexported methods
}
type MsgBus ¶
type MsgBus struct {
// contains filtered or unexported fields
}
func (*MsgBus) AddChannel ¶
func (*MsgBus) ListChannel ¶
type MsgBusOptionFunc ¶
type MsgBusOptionFunc func(*msgBusOptions)
func WithBrokers ¶
func WithBrokers(brokers []string) MsgBusOptionFunc
func WithGroupPrefix ¶
func WithGroupPrefix(prefix string) MsgBusOptionFunc
func WithInsecureTLS ¶
func WithInsecureTLS() MsgBusOptionFunc
WithInsecureTLS enables TLS with insecure verification (for testing)
func WithSASLPlainAuth ¶
func WithSASLPlainAuth(username, password string) MsgBusOptionFunc
WithSASLPlainAuth configures SASL/PLAIN authentication
func WithSASLSCRAMSHA256Auth ¶
func WithSASLSCRAMSHA256Auth(username, password string) MsgBusOptionFunc
WithSASLSCRAMSHA256Auth configures SASL/SCRAM-SHA256 authentication
func WithSASLSCRAMSHA512Auth ¶
func WithSASLSCRAMSHA512Auth(username, password string) MsgBusOptionFunc
WithSASLSCRAMSHA512Auth configures SASL/SCRAM-SHA512 authentication
func WithSaramaConfig ¶
func WithSaramaConfig(config *sarama.Config) MsgBusOptionFunc
func WithSessionTimeout ¶
func WithSessionTimeout(timeout time.Duration) MsgBusOptionFunc
Click to show internal directories.
Click to hide internal directories.