Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: project & design #16

Merged
merged 14 commits into from
Oct 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: update examples section
  • Loading branch information
Abdulsametileri committed Oct 27, 2022
commit c914473054f52088a20def4c01478e833daaa830
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ You can find a number of ready-to-run examples at [this directory](examples).
```go
func main() {
// ...
var consumeFn kcronsumer.ConsumeFn = func(message model.Message) error {
fmt.Printf("consumer > Message received: %s\n", string(message.Value))
return nil
var consumeFn kafka.ConsumeFn = func(message kafka.Message) error {
fmt.Printf("consumer > Message received: %s\n", string(message.Value))
return nil
}

cronsumer := kcronsumer.NewCronsumer(kafkaConfig, consumeFn)
Expand All @@ -56,9 +56,9 @@ func main() {
```go
func main() {
// ...
var consumeFn kcronsumer.ConsumeFn = func(message model.Message) error {
fmt.Printf("consumer > Message received: %s\n", string(message.Value))
return errors.New("error occurred")
var consumeFn kafka.ConsumeFn = func(message kafka.Message) error {
fmt.Printf("consumer > Message received: %s\n", string(message.Value))
return errors.New("error occurred")
}

cronsumer := kcronsumer.NewCronsumer(kafkaConfig, consumeFn)
Expand All @@ -71,16 +71,16 @@ func main() {
```go
func main() {
// ...
var firstConsumerFn kcronsumer.ConsumeFn = func(message model.Message) error {
fmt.Printf("First consumer > Message received: %s\n", string(message.Value))
return nil
var firstConsumerFn kafka.ConsumeFn = func(message kafka.Message) error {
fmt.Printf("First consumer > Message received: %s\n", string(message.Value))
return nil
}
firstHandler := kcronsumer.NewCronsumer(firstCfg, firstConsumerFn)
firstHandler.Start()
var secondConsumerFn kcronsumer.ConsumeFn = func(message model.Message) error {
fmt.Printf("Second consumer > Message received: %s\n", string(message.Value))
return nil

var secondConsumerFn kafka.ConsumeFn = func(message kafka.Message) error {
fmt.Printf("Second consumer > Message received: %s\n", string(message.Value))
return nil
}
secondHandler := kcronsumer.NewCronsumer(secondCfg, secondConsumerFn)
secondHandler.Start()
Expand Down