Documentation ¶
Index ¶
Constants ¶
const (
// Version const
Version = "v0.0.0"
)
Variables ¶
var ( SHA256 scram.HashGeneratorFcn = sha256.New SHA512 scram.HashGeneratorFcn = sha512.New )
var ( // ErrorInvalidCommand error ErrorInvalidCommand = errors.New("invalid command") // ErrorRequiredOneArgument error ErrorRequiredOneArgument = errors.New("require at least one arguments") // ErrorRequiredOneBroker error ErrorRequiredOneBroker = errors.New("require at least one broker") // ErrorPubRequredMessage error ErrorPubRequredMessage = errors.New("pub command require a message") // ErrorRequiredTopicName error ErrorRequiredTopicName = errors.New("require a topic name") )
Functions ¶
This section is empty.
Types ¶
type Argument ¶
type Argument struct { Brokers []string Topic string Command Command ShowVersion bool Help func() Message []byte Verbose bool Auth bool Username string Password string }
Argument struct
type KafkaGoPublisherImpl ¶ added in v1.0.0
type KafkaGoPublisherImpl struct {
// contains filtered or unexported fields
}
KafkaGoPublisherImpl struct
func NewKafkaGoPublisher ¶ added in v1.0.0
func NewKafkaGoPublisher(args *Argument) (*KafkaGoPublisherImpl, error)
NewKafkaGoPublisherImpl constructor of KafkaGoPublisherImpl
type KafkaGoSubscriberImpl ¶ added in v1.0.0
type KafkaGoSubscriberImpl struct {
// contains filtered or unexported fields
}
KafkaGoSubscriberImpl struct
func NewKafkaGoSubscriber ¶ added in v1.0.0
func NewKafkaGoSubscriber(args *Argument) (*KafkaGoSubscriberImpl, error)
NewKafkaGoSubscriber constructor of KafkaGoSubscriberImpl
type Runner ¶
type Runner struct { Publisher Publisher Subscriber Subscriber Argument *Argument }
Runner type
type SaramScramClient ¶ added in v1.0.0
type SaramScramClient struct { *scram.Client *scram.ClientConversation scram.HashGeneratorFcn }
func (*SaramScramClient) Begin ¶ added in v1.0.0
func (x *SaramScramClient) Begin(userName, password, authzID string) (err error)
func (*SaramScramClient) Done ¶ added in v1.0.0
func (x *SaramScramClient) Done() bool
type SaramaPublisherImpl ¶ added in v1.0.0
type SaramaPublisherImpl struct {
// contains filtered or unexported fields
}
SaramaPublisherImpl struct
func NewSaramaPublisher ¶ added in v1.0.0
func NewSaramaPublisher(args *Argument) (*SaramaPublisherImpl, error)
NewSaramaPublisher constructor of SaramaPublisherImpl
type SaramaSubscriberImpl ¶ added in v1.0.0
type SaramaSubscriberImpl struct {
// contains filtered or unexported fields
}
SaramaSubscriberImpl struct
func NewSaramaSubscriber ¶ added in v1.0.0
func NewSaramaSubscriber(args *Argument) (*SaramaSubscriberImpl, error)
NewSaramaSubscriber constructor of SaramaSubscriberImpl
type Subscriber ¶
Subscriber interface
type SubscriberHandler ¶
type SubscriberHandler struct {
// contains filtered or unexported fields
}
SubscriberHandler struct will implement ConsumerGroupHandler
func (*SubscriberHandler) Cleanup ¶
func (handler *SubscriberHandler) Cleanup(sarama.ConsumerGroupSession) error
Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited
func (*SubscriberHandler) ConsumeClaim ¶
func (handler *SubscriberHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages().
func (*SubscriberHandler) Setup ¶
func (handler *SubscriberHandler) Setup(sarama.ConsumerGroupSession) error
Setup is run at the beginning of a new session, before ConsumeClaim