|
|
@ -11,12 +11,13 @@ import ( |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
type AuthPostmanServer struct { |
|
|
|
type AuthPostmanServer struct { |
|
|
|
kafkaReader *kafka.Reader |
|
|
|
|
|
|
|
ctx context.Context |
|
|
|
ctx context.Context |
|
|
|
|
|
|
|
kafkaReader *kafka.Reader |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func NewServer(ctx context.Context, config *config.Config, topic string) *AuthPostmanServer { |
|
|
|
func NewServer(ctx context.Context, config *config.Config, topic string) *AuthPostmanServer { |
|
|
|
return &AuthPostmanServer{ |
|
|
|
return &AuthPostmanServer{ |
|
|
|
|
|
|
|
ctx: ctx, |
|
|
|
kafkaReader: kafka.NewReader(kafka.ReaderConfig{ |
|
|
|
kafkaReader: kafka.NewReader(kafka.ReaderConfig{ |
|
|
|
Topic: topic, |
|
|
|
Topic: topic, |
|
|
|
Brokers: []string{net.JoinHostPort(config.Kafka.Host, strconv.Itoa(config.Kafka.Port))}, |
|
|
|
Brokers: []string{net.JoinHostPort(config.Kafka.Host, strconv.Itoa(config.Kafka.Port))}, |
|
|
@ -25,7 +26,6 @@ func NewServer(ctx context.Context, config *config.Config, topic string) *AuthPo |
|
|
|
MinBytes: 10e3, // 10KB
|
|
|
|
MinBytes: 10e3, // 10KB
|
|
|
|
MaxBytes: 10e6, // 10MB
|
|
|
|
MaxBytes: 10e6, // 10MB
|
|
|
|
}), |
|
|
|
}), |
|
|
|
ctx: ctx, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|