func printBody(entry *cdc.Entry) { body, err := entry.Body() if err != nil { log.Fatal(err) } defer body.Close() io.Copy(os.Stdout, body) }
func printHeader(entry *cdc.Entry) { header, err := entry.Header() if err != nil { log.Fatal(err) } for key := range header { fmt.Printf("%s: %s\n", key, header.Get(key)) } }