Skip to content

Commit

Permalink
(fix): update client to latest todo spec
Browse files Browse the repository at this point in the history
  • Loading branch information
kameshsampath committed Dec 6, 2023
1 parent ae205b3 commit c05eab0
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions cmd/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,26 @@ func main() {
if err != nil {
log.Fatalf("client.TodoList failed: %v", err)
}
log.Infow("Task",
"Title", tr.Task.Title,
"Description", tr.Task.Description,
"Completed", tr.Task.Completed,
"Last Updated", tr.Task.LastUpdated.AsTime().Format(time.RFC850),
"Partition", tr.Partition,
"Offset", tr.Offset,
)

if errs := tr.GetErrors(); errs != nil {
log.Errorln("Errors fetching:")
for _, e := range errs.Error {
log.Errorw("Error Details",
"Topic", e.Topic,
"Partition", e.Partition,
"Error", e.Message,
)
}
} else {
todo := tr.GetTodo()
log.Infow("Task",
"Title", todo.Task.Title,
"Description", todo.Task.Description,
"Completed", todo.Task.Completed,
"Last Updated", todo.Task.LastUpdated.AsTime().Format(time.RFC850),
"Partition", todo.Partition,
"Offset", todo.Offset,
)
}
}
}

0 comments on commit c05eab0

Please sign in to comment.