Debian Codegraph @

udpa/type/v1/typed_struct.proto

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