Documentation ¶
Index ¶
- Constants
- func CheckConsolidate[V proto.Message](check V, out *V) bool
- func Clone[V proto.Message](msg V) V
- func NewFromType[V proto.Message]() V
- func TypeUrl[V proto.Message]() string
- func TypeUrlForInstance(m proto.Message) string
- func WrapAnyOrDie(src protoreflect.ProtoMessage) *anypb.Any
- func WrapAnysOrDie(srcs ...protoreflect.ProtoMessage) []*anypb.Any
- func WriteFile(path string, msg proto.Message) error
- type SerializeOpts
- type TextAndBinary
Constants ¶
View Source
const TypeUrlPrefix = "type.googleapis.com/"
Variables ¶
This section is empty.
Functions ¶
func CheckConsolidate ¶
func NewFromType ¶
func TypeUrlForInstance ¶
func WrapAnyOrDie ¶
func WrapAnyOrDie(src protoreflect.ProtoMessage) *anypb.Any
func WrapAnysOrDie ¶
func WrapAnysOrDie(srcs ...protoreflect.ProtoMessage) []*anypb.Any
Types ¶
type SerializeOpts ¶
type SerializeOpts struct { TextProto bool JSON bool Resolver interface { protoregistry.ExtensionTypeResolver protoregistry.MessageTypeResolver } }
func (SerializeOpts) Serialize ¶
func (opts SerializeOpts) Serialize(msgs ...proto.Message) ([]TextAndBinary, error)
type TextAndBinary ¶
type TextAndBinary struct { Text []byte JSON []byte Binary []byte PerFormat map[string][]byte // Key, one of: binarypb, textpb, json }
func SerializeMultiple ¶
func SerializeMultiple(msgs ...proto.Message) ([]TextAndBinary, error)
Click to show internal directories.
Click to hide internal directories.