Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFunc ¶
func ExtractFunc() func(query.ExtractFunc) query.ExtractFunc
ExtractFunc is a function for query.CustomExtractFunc option to extract values by protobuf struct tag.
Example ¶
v := testpb.OneofMessage{ Value: &testpb.OneofMessage_B_{ B: &testpb.OneofMessage_B{ BarValue: "yyy", }, }, } q := query.New( query.CustomExtractFunc(protobufextractor.ExtractFunc()), query.CustomIsInlineStructFieldFunc(protobufextractor.OneofIsInlineStructFieldFunc()), ).Key("b").Key("bar_value") got, err := q.Extract(v) if err != nil { log.Fatal(err) } fmt.Println(got)
Output: yyy
func OneofIsInlineStructFieldFunc ¶
func OneofIsInlineStructFieldFunc() func(reflect.StructField) bool
OneofIsInlineStructFieldFunc is a function for query.CustomIsInlineStructFieldFunc option to enable extracting values even if the oneof field name is omitted.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.