type Job struct {
Name string
MaskSchema map[string]MaskInfo
}
type MaskInfo struct {
Masked bool
SortCol bool
}
如何将Job表示为avro模式?
答案 0 :(得分:0)
您可以使用goavro:
type Job struct {
Name string
MaskSchema map[string]MaskInfo
}
type MaskInfo struct {
Masked bool
SortCol bool
}
newJob := Job{
// fill the struct
}
textual, err = codec.TextualFromNative(nil, newJob)
if err != nil {
fmt.Println(err)
}
fmt.Println(string(textual))
注意:我没有测试它,但是它应该可以工作。