xds/clients: export TypeURL and Value on AnyProto and remove anypb from resource_type.go
Use case(s) - what problem will this feature solve?
In #8422, AnyProto was introduced in internal/xds/clients/xdsclient/resource_type.go with exported TypeURL string and Value []byte fields so that the exported xdsclient API surface had zero google.golang.org/protobuf imports.
Later, #8640 imported google.golang.org/protobuf/types/known/anypb into resource_type.go, added NewAnyProto(*anypb.Any) and ToAny() *anypb.Any, and unexported typeURL and value. As a result, resource_type.go currently exposes *anypb.Any in its public API surface while still requiring callers and decoders to wrap and unwrap *AnyProto on every decode.
Proposed Solution
Restore the zero-protobuf boundary from #8422 in resource_type.go:
- Re-export
TypeURL stringandValue []byteonAnyProto:type AnyProto struct { TypeURL string Value []byte } - Remove
NewAnyProto(*anypb.Any),ToAny() *anypb.Any, and thegoogle.golang.org/protobuf/types/known/anypbimport fromresource_type.go.
Alternatives Considered
Passing *anypb.Any directly to Decoder.Decode and deleting AnyProto. This was rejected to avoid exposing direct protobuf dependencies in the public API surface.
Additional Context
Part of #9455.
Source: grpc/grpc-go