Skip to content

Commit

Permalink
docs(readme): fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
mingrammer committed Sep 16, 2021
1 parent 9145b55 commit f9f50f8
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,36 @@ Kinesumer manages the state of the distributed clients with a database, called "
package main

import (
"fmt"
"time"
"github.com/daangn/kinesumer"
"fmt"
"time"

"github.com/daangn/kinesumer"
)

func main() {
client, err := kinesumer.NewKinesumer(
&kinesumer.Config{
App: "myapp",
KinesisRegion: "ap-northeast-2",
DynamoDBRegion: "ap-northeast-2",
DynamoDBTable: "kinesumer-state-store",
ScanLimit: 1500,
ScanTimeout: 2 * time.Second,
},
)
if err != nil {
// Error handling.
}
go func() {
for err := range client.Errors() {
// Error handling.
}
}()
// Consume multiple streams.
// You can refresh the streams with `client.Refresh()` method.
records, err := client.Consume([]string{"stream1", "stream2"})
client, err := kinesumer.NewKinesumer(
&kinesumer.Config{
App: "myapp",
KinesisRegion: "ap-northeast-2",
DynamoDBRegion: "ap-northeast-2",
DynamoDBTable: "kinesumer-state-store",
ScanLimit: 1500,
ScanTimeout: 2 * time.Second,
},
)
if err != nil {
// Error handling.
}

go func() {
for err := range client.Errors() {
// Error handling.
}
}()

// Consume multiple streams.
// You can refresh the streams with `client.Refresh()` method.
records, err := client.Consume([]string{"stream1", "stream2"})
if err != nil {
// Error handling.
}
Expand All @@ -67,7 +67,6 @@ func main() {
fmt.Printf("record: %v\n", record)
}
}

```

## How it works
Expand Down

0 comments on commit f9f50f8

Please sign in to comment.