Documentation ¶
Index ¶
Constants ¶
View Source
const ( Driver = "postgres" DSN = "postgres://$SVC_DB_USER_NAME:$SVC_DB_PASSWORD@$SVC_DB_HOST:$SVC_DB_PORT/$SVC_DB_DATABASE?sslmode=disable" )
View Source
const ( KafkaAddr = "$SVC_KAFKA_HOST:$SVC_KAFKA_PORT" KafkaGroupID = "$SVC_KAFKA_GROUP_ID" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KafkaHandlerFunc ¶
func (KafkaHandlerFunc) HandleMessage ¶
func (f KafkaHandlerFunc) HandleMessage(ctx context.Context, msg []byte) error
type KafkaProcessor ¶
type KafkaProcessor struct {
// contains filtered or unexported fields
}
func NewKafkaProcessor ¶
func NewKafkaProcessor() (*KafkaProcessor, error)
func (*KafkaProcessor) Close ¶
func (c *KafkaProcessor) Close()
func (*KafkaProcessor) RegisterHandler ¶
func (c *KafkaProcessor) RegisterHandler(topic string, handler KafkaHandler)
func (*KafkaProcessor) RegisterHandlerFunc ¶
func (*KafkaProcessor) Start ¶
func (c *KafkaProcessor) Start(ctx context.Context)
type KafkaSender ¶
type KafkaSender struct {
// contains filtered or unexported fields
}
func NewKafkaSender ¶
func NewKafkaSender() (*KafkaSender, error)
func (*KafkaSender) Close ¶
func (s *KafkaSender) Close()
type SimpleConsumerGroupHandler ¶
type SimpleConsumerGroupHandler struct {
// contains filtered or unexported fields
}
func NewSimpleConsumerGroupHandler ¶
func NewSimpleConsumerGroupHandler(processor KafkaHandler) *SimpleConsumerGroupHandler
func (SimpleConsumerGroupHandler) Cleanup ¶
func (c SimpleConsumerGroupHandler) Cleanup(sarama.ConsumerGroupSession) error
func (SimpleConsumerGroupHandler) ConsumeClaim ¶
func (c SimpleConsumerGroupHandler) ConsumeClaim( session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim, ) (err error)
func (SimpleConsumerGroupHandler) Setup ¶
func (c SimpleConsumerGroupHandler) Setup(sarama.ConsumerGroupSession) error
Click to show internal directories.
Click to hide internal directories.