Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Employee = Schemas{ ParentSchema: `{ "type": "record", "name": "Employee", "namespace": "com.company.hr", "fields": [ {"name": "personalInfo", "type": "PersonalInfo"}, {"name": "department", "type": "string"}, {"name": "role", "type": "string"}, {"name": "yearsOfExperience", "type": "int"} ] }`, ChildSchemas: map[string]string{ "PersonalInfo": `{ "type": "record", "name": "PersonalInfo", "namespace": "com.company.hr", "fields": [ {"name": "name", "type": "string"}, {"name": "age", "type": "int"}, {"name": "address", "type": "string"} ] }`, }, ExpectedSchema: `{ "type": "record", "name": "Employee", "namespace": "com.company.hr", "fields": [ { "name": "personalInfo", "type": { "type": "record", "name": "PersonalInfo", "namespace": "com.company.hr", "fields": [ {"name": "name", "type": "string"}, {"name": "age", "type": "int"}, {"name": "address", "type": "string"} ] } }, {"name": "department", "type": "string"}, {"name": "role", "type": "string"}, {"name": "yearsOfExperience", "type": "int"} ] } `, }
* * * TEST SCHEMA *
View Source
var User = Schemas{ ParentSchema: `{ "type": "record", "name": "User", "namespace": "com.example", "fields": [ {"name": "headers", "type": "Headers"}, {"name": "things", "type": "Things"}, {"name": "name", "type": "string"}, {"name": "age", "type": "int"} ] }`, ChildSchemas: map[string]string{ "Headers": `{ "type": "record", "name": "Headers", "namespace": "com.example", "fields": [ {"name": "headerName", "type": "string"}, {"name": "headerAge", "type": "int"} ] }`, "Things": `{ "type": "record", "name": "Things", "namespace": "com.example", "fields": [ {"name": "stuff", "type": "string"} ] }`, }, ExpectedSchema: `{ "type": "record", "name": "User", "namespace": "com.example", "fields": [ {"name": "headers", "type": { "type": "record", "name": "Headers", "namespace": "com.example", "fields": [ {"name": "headerName", "type": "string"}, {"name": "headerAge", "type": "int"} ] }}, {"name": "things", "type": { "type": "record", "name": "Things", "namespace": "com.example", "fields": [ {"name": "stuff", "type": "string"} ] }}, {"name": "name", "type": "string"}, {"name": "age", "type": "int"} ] }`, }
* * * ORIGINAL TEST SCHEMA *
Functions ¶
func MergeSchemas ¶
MergeSchemas takes a parent schema and a map of child schemas and returns a combined schema
Types ¶
type AvroSchema ¶
Click to show internal directories.
Click to hide internal directories.