Skip to content

Latest commit

 

History

History
41 lines (35 loc) · 574 Bytes

README.md

File metadata and controls

41 lines (35 loc) · 574 Bytes

avro-schema-gen

Gen Avro schema from Go struct.

For example, from this struct

type Pointer struct {
	in *int
}

avro-schema-gen will create a schema like this

{
    "type":"record",
    "name":"Pointer",
    "fields":[
        {
            "name":"in",
            "default":null,
            "type":[
                "null",
                "long"
            ]
        }
    ]
}

How to use

import avroschema "github.com/badboyd/avro-schema-gen"

type Pointer struct {
	in *int
}

func main() {
    avroschema.Generate(Pointer{})
}