1

I'm currently working on a project where I need to generate an Avro schema file from a Go struct. I want to know if there is any existing solution or library that can assist me in achieving this.

Ideally, I would like to find a way to automatically generate the Avro schema based on the defined struct in Go. This would greatly simplify the process of defining and maintaining the schema separately.

If anyone has any insights, recommendations, or example code snippets on how to accomplish this task, I would greatly appreciate your help!

Example: For instance, consider the following Go struct:

type User struct {
    ID        int    `avro:"id" json:"id"`
    Name      string `avro:"name" json:"name"`
    Age       int    `avro:"age" json:"age"`
    Email     string `avro:"email" json:"email"`
    Timestamp int64  `avro:"timestamp" json:"timestamp"`
}

I would like to generate an Avro schema file that reflects the structure and field types of this Go struct automatically. This would enable me to share the schema with other systems.

Any guidance or suggestions on how to achieve this would be greatly appreciated. Thank you in advance for your help!

Grokify
  • 15,092
  • 6
  • 60
  • 81
Yash Chauhan
  • 174
  • 13

0 Answers0