Debian Codegraph @

xds/type/v3/typed_struct.proto

raw
1 syntax = "proto3";
2
3 package xds.type.v3;
4
5 option java_outer_classname = "TypedStructProto";
6 option java_multiple_files = true;
7 option java_package = "com.github.xds.type.v3";
8 option go_package = "github.com/cncf/xds/go/xds/type/v3";
9
10 import "google/protobuf/struct.proto";
11
12 // A TypedStruct contains an arbitrary JSON serialized protocol buffer message with a URL that
13 // describes the type of the serialized message. This is very similar to google.protobuf.Any,
14 // instead of having protocol buffer binary, this employs google.protobuf.Struct as value.
15 //
16 // This message is intended to be embedded inside Any, so it shouldn't be directly referred
17 // from other UDPA messages.
18 //
19 // When packing an opaque extension config, packing the expected type into Any is preferred
20 // wherever possible for its efficiency. TypedStruct should be used only if a proto descriptor
21 // is not available, for example if:
22 //
23 // - A control plane sends opaque message that is originally from external source in human readable
24 // format such as JSON or YAML.
25 // - The control plane doesn't have the knowledge of the protocol buffer schema hence it cannot
26 // serialize the message in protocol buffer binary format.
27 // - The DPLB doesn't have have the knowledge of the protocol buffer schema its plugin or extension
28 // uses. This has to be indicated in the DPLB capability negotiation.
29 //
30 // When a DPLB receives a TypedStruct in Any, it should:
31 // - Check if the type_url of the TypedStruct matches the type the extension expects.
32 // - Convert value to the type described in type_url and perform validation.
33 //
34 // TODO(lizan): Figure out how TypeStruct should be used with DPLB extensions that doesn't link
35 // protobuf descriptor with DPLB itself, (e.g. gRPC LB Plugin, Envoy WASM extensions).
36 message TypedStruct {
37 // A URL that uniquely identifies the type of the serialize protocol buffer message.
38 // This has same semantics and format described in google.protobuf.Any:
39 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto
40 string type_url = 1;
41
42 // A JSON representation of the above specified type.
43 google.protobuf.Struct value = 2;
44 }