Documentation ¶
Index ¶
- Variables
- func MarshalFrom(dst *Any, src proto.Message, opts proto.MarshalOptions) error
- func UnmarshalNew(src *Any, opts proto.UnmarshalOptions) (dst proto.Message, err error)
- func UnmarshalTo(src *Any, dst proto.Message, opts proto.UnmarshalOptions) error
- type Any
- func (*Any) Descriptor() ([]byte, []int)deprecated
- func (x *Any) GetTypeUrl() string
- func (x *Any) GetValue() []byte
- func (x *Any) MarshalFrom(m proto.Message) error
- func (x *Any) MessageIs(m proto.Message) bool
- func (x *Any) MessageName() protoreflect.FullName
- func (*Any) ProtoMessage()
- func (x *Any) ProtoReflect() protoreflect.Message
- func (x *Any) Reset()
- func (x *Any) String() string
- func (x *Any) UnmarshalNew() (proto.Message, error)
- func (x *Any) UnmarshalTo(m proto.Message) error
Constants ¶
This section is empty.
Variables ¶
var File_any_proto protoreflect.FileDescriptor
Functions ¶
func MarshalFrom ¶
MarshalFrom marshals src into dst as the underlying message using the provided marshal options.
If no options are specified, call dst.MarshalFrom instead.
func UnmarshalNew ¶
UnmarshalNew unmarshals the underlying message from src into dst, which is newly created message using a type resolved from the type URL. The message type is resolved according to opt.Resolver, which should implement protoregistry.MessageTypeResolver. It reports an error if the underlying message type could not be resolved.
If no options are specified, call src.UnmarshalNew instead.
func UnmarshalTo ¶
UnmarshalTo unmarshals the underlying message from src into dst using the provided unmarshal options. It reports an error if dst is not of the right message type.
If no options are specified, call src.UnmarshalTo instead.
Types ¶
type Any ¶
type Any struct { // A URL/resource name that uniquely identifies the type of the serialized // protocol buffer message. This string must contain at least // one "/" character. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). // // In practice, teams usually precompile into the binary all types that they // expect it to use in the context of Any. However, for URLs which use the // scheme `http`, `https`, or no scheme, one can optionally set up a type // server that maps type URLs to message definitions as follows: // // * If no scheme is provided, `https` is assumed. // * An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // * Applications are allowed to cache lookup results based on the // URL, or have them precompiled into a binary to avoid any // lookup. Therefore, binary compatibility needs to be preserved // on changes to types. (Use versioned type names to manage // breaking changes.) // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with // type.googleapis.com. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. // TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` // Must be a valid serialized protocol buffer of the above specified type. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Any) Descriptor
deprecated
func (*Any) GetTypeUrl ¶
func (*Any) MarshalFrom ¶
MarshalFrom marshals m into x as the underlying message.
func (*Any) MessageName ¶
func (x *Any) MessageName() protoreflect.FullName
MessageName reports the full name of the underlying message, returning an empty string if invalid.
func (*Any) ProtoMessage ¶
func (*Any) ProtoMessage()
func (*Any) ProtoReflect ¶
func (x *Any) ProtoReflect() protoreflect.Message
func (*Any) UnmarshalNew ¶
UnmarshalNew unmarshals the contents of the underlying message of x into a newly allocated message of the specified type. It reports an error if the underlying message type could not be resolved.