Movatterモバイル変換


[0]ホーム

URL:


Warning Deprecated: Use the "google.golang.org/protobuf" module instead.

proto

package
v1.5.4Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License:BSD-3-ClauseImports:23Imported by:169,579

Details

Repository

github.com/golang/protobuf

Links

Documentation

Overview

Package proto provides functionality for handling protocol buffer messages.In particular, it provides marshaling and unmarshaling between a protobufmessage and the binary wire format.

Seehttps://developers.google.com/protocol-buffers/docs/gotutorial formore information.

Deprecated: Use the "google.golang.org/protobuf/proto" package instead.

Index

Constants

View Source
const (WireVarint     = 0WireFixed32    = 5WireFixed64    = 1WireBytes      = 2WireStartGroup = 3WireEndGroup   = 4)
View Source
const (ProtoPackageIsVersion1 =trueProtoPackageIsVersion2 =trueProtoPackageIsVersion3 =trueProtoPackageIsVersion4 =true)

Variables

View Source
var (// Deprecated: No longer returned.ErrNil =errors.New("proto: Marshal called with nil")// Deprecated: No longer returned.ErrTooLarge =errors.New("proto: message encodes to over 2 GB")// Deprecated: No longer returned.ErrInternalBadWireType =errors.New("proto: internal error: bad wiretype for oneof"))
View Source
var ErrMissingExtension =errors.New("proto: missing extension")

ErrMissingExtension reports whether the extension was not present.

Functions

funcBool

func Bool(vbool) *bool

Bool stores v in a new bool value and returns a pointer to it.

funcClearAllExtensions

func ClearAllExtensions(mMessage)

ClearAllExtensions clears all extensions from m.This includes populated fields and unknown fields in the extension range.

funcClearExtension

func ClearExtension(mMessage, xt *ExtensionDesc)

ClearExtension removes the extension field from meither as an explicitly populated field or as an unknown field.

funcCompactText

func CompactText(wio.Writer, mMessage)error

CompactText writes the compact proto text format of m to w.

funcCompactTextString

func CompactTextString(mMessage)string

CompactTextString returns a compact proto text formatted string of m.

funcDecodeVarint

func DecodeVarint(b []byte) (uint64,int)

DecodeVarint parses a varint encoded integer from b,returning the integer value and the length of the varint.It returns (0, 0) if there is a parse error.

funcDiscardUnknown

func DiscardUnknown(mMessage)

DiscardUnknown recursively discards all unknown fields from this messageand all embedded messages.

When unmarshaling a message with unrecognized fields, the tags and valuesof such fields are preserved in the Message. This allows a later call tomarshal to be able to produce a message that continues to have thoseunrecognized fields. To avoid this, DiscardUnknown is used toexplicitly clear the unknown fields after unmarshaling.

funcEncodeVarint

func EncodeVarint(vuint64) []byte

EncodeVarint returns the varint encoded bytes of v.

funcEnumNamedeprecated

func EnumName(m map[int32]string, vint32)string

Deprecated: Do not use.

funcEnumValueMapdeprecated

func EnumValueMap(s enumName) enumsByName

EnumValueMap returns the mapping from enum value names to enum numbers forthe enum of the given name. It returns nil if not found.

Deprecated: Use protoregistry.GlobalTypes.FindEnumByName instead.

funcEqual

func Equal(x, yMessage)bool

Equal reports whether two messages are equal.If two messages marshal to the same bytes under deterministic serialization,then Equal is guaranteed to report true.

Two messages are equal if they are the same protobuf message type,have the same set of populated known and extension field values,and the same set of unknown fields values.

Scalar values are compared with the equivalent of the == operator in Go,except bytes values which are compared using bytes.Equal andfloating point values which specially treat NaNs as equal.Message values are compared by recursively calling Equal.Lists are equal if each element value is also equal.Maps are equal if they have the same set of keys, where the pair of valuesfor each key is also equal.

funcFileDescriptordeprecated

func FileDescriptor(s filePath) fileDescGZIP

FileDescriptor returns the compressed FileDescriptorProto given the file pathfor a proto source file. It returns nil if not found.

Deprecated: Use protoregistry.GlobalFiles.FindFileByPath instead.

funcFloat32

func Float32(vfloat32) *float32

Float32 stores v in a new float32 value and returns a pointer to it.

funcFloat64

func Float64(vfloat64) *float64

Float64 stores v in a new float64 value and returns a pointer to it.

funcGetExtension

func GetExtension(mMessage, xt *ExtensionDesc) (interface{},error)

GetExtension retrieves a proto2 extended field from m.

If the descriptor is type complete (i.e., ExtensionDesc.ExtensionType is non-nil),then GetExtension parses the encoded field and returns a Go value of the specified type.If the field is not present, then the default value is returned (if one is specified),otherwise ErrMissingExtension is reported.

If the descriptor is type incomplete (i.e., ExtensionDesc.ExtensionType is nil),then GetExtension returns the raw encoded bytes for the extension field.

funcGetExtensions

func GetExtensions(mMessage, xts []*ExtensionDesc) ([]interface{},error)

GetExtensions returns a list of the extensions values present in m,corresponding with the provided list of extension descriptors, xts.If an extension is missing in m, the corresponding value is nil.

funcHasExtension

func HasExtension(mMessage, xt *ExtensionDesc) (hasbool)

HasExtension reports whether the extension field is present in meither as an explicitly populated field or as an unknown field.

funcIntdeprecated

func Int(vint) *int32

Int stores v in a new int32 value and returns a pointer to it.

Deprecated: Use Int32 instead.

funcInt32

func Int32(vint32) *int32

Int32 stores v in a new int32 value and returns a pointer to it.

funcInt64

func Int64(vint64) *int64

Int64 stores v in a new int64 value and returns a pointer to it.

funcMarshal

func Marshal(mMessage) ([]byte,error)

Marshal returns the wire-format encoding of m.

funcMarshalMessageSetdeprecated

func MarshalMessageSet(interface{}) ([]byte,error)

Deprecated: Do not use.

funcMarshalMessageSetJSONdeprecated

func MarshalMessageSetJSON(interface{}) ([]byte,error)

Deprecated: Do not use.

funcMarshalText

func MarshalText(wio.Writer, mMessage)error

MarshalText writes the proto text format of m to w.

funcMarshalTextString

func MarshalTextString(mMessage)string

MarshalTextString returns a proto text formatted string of m.

funcMerge

func Merge(dst, srcMessage)

Merge merges src into dst, which must be messages of the same type.

Populated scalar fields in src are copied to dst, while populatedsingular messages in src are merged into dst by recursively calling Merge.The elements of every list field in src is appended to the correspondedlist fields in dst. The entries of every map field in src is copied intothe corresponding map field in dst, possibly replacing existing entries.The unknown fields of src are appended to the unknown fields of dst.

funcMessageNamedeprecated

func MessageName(mMessage) messageName

MessageName returns the full protobuf name for the given message type.

Deprecated: Use protoreflect.MessageDescriptor.FullName instead.

funcMessageReflectadded inv1.4.0

func MessageReflect(mMessage)protoreflect.Message

MessageReflect returns a reflective view for a message.It returns nil if m is nil.

funcMessageTypedeprecated

func MessageType(s messageName)reflect.Type

MessageType returns the message type for a named message.It returns nil if not found.

Deprecated: Use protoregistry.GlobalTypes.FindMessageByName instead.

funcMessageV1added inv1.4.0

MessageV1 converts either a v1 or v2 message to a v1 message.It returns nil if m is nil.

funcMessageV2added inv1.4.0

MessageV2 converts either a v1 or v2 message to a v2 message.It returns nil if m is nil.

funcRegisterEnumdeprecated

func RegisterEnum(s enumName, _ enumsByNumber, m enumsByName)

RegisterEnum is called from the generated code to register the mapping ofenum value names to enum numbers for the enum identified by s.

Deprecated: Use protoregistry.GlobalTypes.RegisterEnum instead.

funcRegisterExtensiondeprecated

func RegisterExtension(d *ExtensionDesc)

RegisterExtension is called from the generated code to registerthe extension descriptor.

Deprecated: Use protoregistry.GlobalTypes.RegisterExtension instead.

funcRegisterFiledeprecated

func RegisterFile(s filePath, d fileDescGZIP)

RegisterFile is called from generated code to register the compressedFileDescriptorProto with the file path for a proto source file.

Deprecated: Use protoregistry.GlobalFiles.RegisterFile instead.

funcRegisterMapTypedeprecatedadded inv1.1.0

func RegisterMapType(m interface{}, s messageName)

RegisterMapType is called from generated code to register the Go map typefor a protobuf message representing a map entry.

Deprecated: Do not use.

funcRegisterMessageSetTypedeprecated

func RegisterMessageSetType(Message,int32,string)

Deprecated: Do not use.

funcRegisterTypedeprecated

func RegisterType(mMessage, s messageName)

RegisterType is called from generated code to register the message Go typefor a message of the given name.

Deprecated: Use protoregistry.GlobalTypes.RegisterMessage instead.

funcRegisteredExtensionsdeprecated

func RegisteredExtensions(mMessage) extensionsByNumber

RegisteredExtensions returns a map of the registered extensions for theprovided protobuf message, indexed by the extension field number.

Deprecated: Use protoregistry.GlobalTypes.RangeExtensionsByMessage instead.

funcSetDefaults

func SetDefaults(mMessage)

SetDefaults sets unpopulated scalar fields to their default values.Fields within a oneof are not set even if they have a default value.SetDefaults is recursively called upon any populated message fields.

funcSetExtension

func SetExtension(mMessage, xt *ExtensionDesc, v interface{})error

SetExtension sets an extension field in m to the provided value.

funcSetRawExtensiondeprecated

func SetRawExtension(mMessage, fnumint32, b []byte)

SetRawExtension inserts b into the unknown fields of m.

Deprecated: Use Message.ProtoReflect.SetUnknown instead.

funcSize

func Size(mMessage)int

Size returns the size in bytes of the wire-format encoding of m.

funcSizeVarint

func SizeVarint(vuint64)int

SizeVarint returns the length of the varint encoded bytes of v.This is equal to len(EncodeVarint(v)).

funcString

func String(vstring) *string

String stores v in a new string value and returns a pointer to it.

funcUint32

func Uint32(vuint32) *uint32

Uint32 stores v in a new uint32 value and returns a pointer to it.

funcUint64

func Uint64(vuint64) *uint64

Uint64 stores v in a new uint64 value and returns a pointer to it.

funcUnmarshal

func Unmarshal(b []byte, mMessage)error

Unmarshal parses a wire-format message in b and places the decoded results in m.

Unmarshal resets m before starting to unmarshal, so any existing data in m is alwaysremoved. Use UnmarshalMerge to preserve and append to existing data.

funcUnmarshalJSONEnumdeprecated

func UnmarshalJSONEnum(m map[string]int32, data []byte, enumNamestring) (int32,error)

Deprecated: Do not use.

funcUnmarshalMerge

func UnmarshalMerge(b []byte, mMessage)error

UnmarshalMerge parses a wire-format message in b and places the decoded results in m.

funcUnmarshalMessageSetdeprecated

func UnmarshalMessageSet([]byte, interface{})error

Deprecated: Do not use.

funcUnmarshalMessageSetJSONdeprecated

func UnmarshalMessageSetJSON([]byte, interface{})error

Deprecated: Do not use.

funcUnmarshalText

func UnmarshalText(sstring, mMessage)error

UnmarshalText parses a proto text formatted string into m.

Types

typeBuffer

type Buffer struct {// contains filtered or unexported fields}

Buffer is a buffer for encoding and decoding the protobuf wire format.It may be reused between invocations to reduce memory usage.

funcNewBuffer

func NewBuffer(buf []byte) *Buffer

NewBuffer allocates a new Buffer initialized with buf,where the contents of buf are considered the unread portion of the buffer.

func (*Buffer)Bytes

func (b *Buffer) Bytes() []byte

Bytes returns the internal buffer.

func (*Buffer)DebugPrint

func (*Buffer) DebugPrint(sstring, b []byte)

DebugPrint dumps the encoded bytes of b with a header and footer including sto stdout. This is only intended for debugging.

func (*Buffer)DecodeFixed32

func (b *Buffer) DecodeFixed32() (uint64,error)

DecodeFixed32 consumes a 32-bit little-endian integer from the buffer.

func (*Buffer)DecodeFixed64

func (b *Buffer) DecodeFixed64() (uint64,error)

DecodeFixed64 consumes a 64-bit little-endian integer from the buffer.

func (*Buffer)DecodeGroup

func (b *Buffer) DecodeGroup(mMessage)error

DecodeGroup consumes a message group from the buffer.It assumes that the start group marker has already been consumed andconsumes all bytes until (and including the end group marker).It does not reset m before unmarshaling.

func (*Buffer)DecodeMessage

func (b *Buffer) DecodeMessage(mMessage)error

DecodeMessage consumes a length-prefixed message from the buffer.It does not reset m before unmarshaling.

func (*Buffer)DecodeRawBytes

func (b *Buffer) DecodeRawBytes(allocbool) ([]byte,error)

DecodeRawBytes consumes a length-prefixed raw bytes from the buffer.If alloc is specified, it returns a copy the raw bytesrather than a sub-slice of the buffer.

func (*Buffer)DecodeStringBytes

func (b *Buffer) DecodeStringBytes() (string,error)

DecodeStringBytes consumes a length-prefixed raw bytes from the buffer.It does not validate whether the raw bytes contain valid UTF-8.

func (*Buffer)DecodeVarint

func (b *Buffer) DecodeVarint() (uint64,error)

DecodeVarint consumes an encoded unsigned varint from the buffer.

func (*Buffer)DecodeZigzag32

func (b *Buffer) DecodeZigzag32() (uint64,error)

DecodeZigzag32 consumes an encoded 32-bit zig-zag varint from the buffer.

func (*Buffer)DecodeZigzag64

func (b *Buffer) DecodeZigzag64() (uint64,error)

DecodeZigzag64 consumes an encoded 64-bit zig-zag varint from the buffer.

func (*Buffer)EncodeFixed32

func (b *Buffer) EncodeFixed32(vuint64)error

EncodeFixed32 appends a 32-bit little-endian integer to the buffer.

func (*Buffer)EncodeFixed64

func (b *Buffer) EncodeFixed64(vuint64)error

EncodeFixed64 appends a 64-bit little-endian integer to the buffer.

func (*Buffer)EncodeMessage

func (b *Buffer) EncodeMessage(mMessage)error

EncodeMessage appends a length-prefixed encoded message to the buffer.

func (*Buffer)EncodeRawBytes

func (b *Buffer) EncodeRawBytes(v []byte)error

EncodeRawBytes appends a length-prefixed raw bytes to the buffer.

func (*Buffer)EncodeStringBytes

func (b *Buffer) EncodeStringBytes(vstring)error

EncodeStringBytes appends a length-prefixed raw bytes to the buffer.It does not validate whether v contains valid UTF-8.

func (*Buffer)EncodeVarint

func (b *Buffer) EncodeVarint(vuint64)error

EncodeVarint appends an unsigned varint encoding to the buffer.

func (*Buffer)EncodeZigzag32

func (b *Buffer) EncodeZigzag32(vuint64)error

EncodeZigzag32 appends a 32-bit zig-zag varint encoding to the buffer.

func (*Buffer)EncodeZigzag64

func (b *Buffer) EncodeZigzag64(vuint64)error

EncodeZigzag64 appends a 64-bit zig-zag varint encoding to the buffer.

func (*Buffer)Marshal

func (b *Buffer) Marshal(mMessage)error

Marshal appends the wire-format encoding of m to the buffer.

func (*Buffer)Reset

func (b *Buffer) Reset()

Reset clears the internal buffer of all written and unread data.

func (*Buffer)SetBuf

func (b *Buffer) SetBuf(buf []byte)

SetBuf sets buf as the internal buffer,where the contents of buf are considered the unread portion of the buffer.

func (*Buffer)SetDeterministicadded inv1.1.0

func (b *Buffer) SetDeterministic(deterministicbool)

SetDeterministic specifies whether to use deterministic serialization.

Deterministic serialization guarantees that for a given binary, equalmessages will always be serialized to the same bytes. This implies:

  • Repeated serialization of a message will return the same bytes.
  • Different processes of the same binary (which may be executing ondifferent machines) will serialize equal messages to the same bytes.

Note that the deterministic serialization is NOT canonical acrosslanguages. It is not guaranteed to remain stable over time. It is unstableacross different builds with schema changes due to unknown fields.Users who need canonical serialization (e.g., persistent storage in acanonical form, fingerprinting, etc.) should define their owncanonicalization specification and implement their own serializer ratherthan relying on this API.

If deterministic serialization is requested, map entries will be sortedby keys in lexographical order. This is an implementation detail andsubject to change.

func (*Buffer)Unmarshal

func (b *Buffer) Unmarshal(mMessage)error

Unmarshal parses the wire-format message in the buffer andplaces the decoded results in m.It does not reset m before unmarshaling.

func (*Buffer)Unreadadded inv1.4.0

func (b *Buffer) Unread() []byte

Unread returns the unread portion of the buffer.

typeExtensiondeprecated

type Extension =protoimpl.ExtensionFieldV1

Deprecated: Do not use; this is an internal type.

typeExtensionDesc

type ExtensionDesc =protoimpl.ExtensionInfo

ExtensionDesc represents an extension descriptor andis used to interact with an extension field in a message.

Variables of this type are generated in code by protoc-gen-go.

funcExtensionDescs

func ExtensionDescs(mMessage) ([]*ExtensionDesc,error)

ExtensionDescs returns a list of extension descriptors found in m,containing descriptors for both populated extension fields in m andalso unknown fields of m that are in the extension range.For the later case, an type incomplete descriptor is provided where onlythe ExtensionDesc.Field field is populated.The order of the extension descriptors is undefined.

typeExtensionRange

type ExtensionRange =protoiface.ExtensionRangeV1

ExtensionRange represents a range of message extensions.Used in code generated by protoc-gen-go.

typeGeneratedEnumadded inv1.4.0

type GeneratedEnum interface{}

GeneratedEnum is any enum type generated by protoc-gen-gowhich is a named int32 kind.This type exists for documentation purposes.

typeGeneratedMessageadded inv1.4.0

type GeneratedMessage interface{}

GeneratedMessage is any message type generated by protoc-gen-gowhich is a pointer to a named struct kind.This type exists for documentation purposes.

typeInternalMessageInfodeprecatedadded inv1.1.0

type InternalMessageInfo struct{}

Deprecated: Do not use; this type existed for intenal-use only.

func (*InternalMessageInfo)DiscardUnknowndeprecatedadded inv1.1.0

func (*InternalMessageInfo) DiscardUnknown(mMessage)

Deprecated: Do not use; this method existed for intenal-use only.

func (*InternalMessageInfo)Marshaldeprecatedadded inv1.1.0

func (*InternalMessageInfo) Marshal(b []byte, mMessage, deterministicbool) ([]byte,error)

Deprecated: Do not use; this method existed for intenal-use only.

func (*InternalMessageInfo)Mergedeprecatedadded inv1.1.0

func (*InternalMessageInfo) Merge(dst, srcMessage)

Deprecated: Do not use; this method existed for intenal-use only.

func (*InternalMessageInfo)Sizedeprecatedadded inv1.1.0

Deprecated: Do not use; this method existed for intenal-use only.

func (*InternalMessageInfo)Unmarshaldeprecatedadded inv1.1.0

func (*InternalMessageInfo) Unmarshal(mMessage, b []byte)error

Deprecated: Do not use; this method existed for intenal-use only.

typeMarshalerdeprecated

type Marshaler interface {// Marshal formats the encoded bytes of the message.// It should be deterministic and emit valid protobuf wire data.// The caller takes ownership of the returned buffer.Marshal() ([]byte,error)}

Marshaler is implemented by messages that can marshal themselves.This interface is used by the following functions: Size, Marshal,Buffer.Marshal, and Buffer.EncodeMessage.

Deprecated: Do not implement.

typeMergerdeprecatedadded inv1.1.0

type Merger interface {// Merge merges the contents of src into the receiver message.// It clones all data structures in src such that it aliases no mutable// memory referenced by src.Merge(srcMessage)}

Merger is implemented by messages that can merge themselves.This interface is used by the following functions: Clone and Merge.

Deprecated: Do not implement.

typeMessage

type Message =protoiface.MessageV1

Message is a protocol buffer message.

This is the v1 version of the message interface and is marginally betterthan an empty interface as it lacks any method to programatically interactwith the contents of the message.

A v2 message is declared in "google.golang.org/protobuf/proto".Message andexposes protobuf reflection as a first-class feature of the interface.

To convert a v1 message to a v2 message, use the MessageV2 function.To convert a v2 message to a v1 message, use the MessageV1 function.

funcClone

func Clone(srcMessage)Message

Clone returns a deep copy of src.

typeOneofPropertiesdeprecated

type OneofProperties struct {// Type is a pointer to the generated wrapper type for the field value.// This is nil for messages that are not in the open-struct API.Typereflect.Type// Field is the index into StructProperties.Prop for the containing oneof.Fieldint// Prop is the properties for the field.Prop *Properties}

OneofProperties represents the type information for a protobuf oneof.

Deprecated: Do not use.

typeParseError

type ParseError struct {Messagestring// Deprecated: Do not use.Line, Offsetint}

ParseError is returned by UnmarshalText.

func (*ParseError)Error

func (e *ParseError) Error()string

typePropertiesdeprecated

type Properties struct {// Name is a placeholder name with little meaningful semantic value.// If the name has an "XXX_" prefix, the entire Properties must be ignored.Namestring// OrigName is the protobuf field name or oneof name.OrigNamestring// JSONName is the JSON name for the protobuf field.JSONNamestring// Enum is a placeholder name for enums.// For historical reasons, this is neither the Go name for the enum,// nor the protobuf name for the enum.Enumstring// Deprecated: Do not use.// Weak contains the full name of the weakly referenced message.Weakstring// Wire is a string representation of the wire type.Wirestring// WireType is the protobuf wire type for the field.WireTypeint// Tag is the protobuf field number.Tagint// Required reports whether this is a required field.Requiredbool// Optional reports whether this is a optional field.Optionalbool// Repeated reports whether this is a repeated field.Repeatedbool// Packed reports whether this is a packed repeated field of scalars.Packedbool// Proto3 reports whether this field operates under the proto3 syntax.Proto3bool// Oneof reports whether this field belongs within a oneof.Oneofbool// Default is the default value in string form.Defaultstring// HasDefault reports whether the field has a default value.HasDefaultbool// MapKeyProp is the properties for the key field for a map field.MapKeyProp *Properties// MapValProp is the properties for the value field for a map field.MapValProp *Properties}

Properties represents the type information for a protobuf message field.

Deprecated: Do not use.

func (*Properties)Initdeprecated

func (p *Properties) Init(typreflect.Type, name, tagstring, f *reflect.StructField)

Init populates the properties from a protocol buffer struct tag.

Deprecated: Do not use.

func (*Properties)Parse

func (p *Properties) Parse(tagstring)

Parse populates p by parsing a string in the protobuf struct field tag style.

func (*Properties)String

func (p *Properties) String()string

String formats the properties in the protobuf struct field tag style.

typeRequiredNotSetError

type RequiredNotSetError struct {// contains filtered or unexported fields}

RequiredNotSetError is an error type returned whenmarshaling or unmarshaling a message with missing required fields.

func (*RequiredNotSetError)Error

func (e *RequiredNotSetError) Error()string

func (*RequiredNotSetError)RequiredNotSetadded inv1.2.0

func (e *RequiredNotSetError) RequiredNotSet()bool

typeStatsdeprecated

type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Sizeuint64 }

Deprecated: Do not use.

funcGetStatsdeprecated

func GetStats()Stats

Deprecated: Do not use.

typeStructPropertiesdeprecated

type StructProperties struct {// Prop are the properties for each field.//// Fields belonging to a oneof are stored in OneofTypes instead, with a// single Properties representing the parent oneof held here.//// The order of Prop matches the order of fields in the Go struct.// Struct fields that are not related to protobufs have a "XXX_" prefix// in the Properties.Name and must be ignored by the user.Prop []*Properties// OneofTypes contains information about the oneof fields in this message.// It is keyed by the protobuf field name.OneofTypes map[string]*OneofProperties}

StructProperties represents protocol buffer type information for agenerated protobuf message in the open-struct API.

Deprecated: Do not use.

funcGetPropertiesdeprecated

func GetProperties(treflect.Type) *StructProperties

GetProperties returns the list of properties for the type represented by t,which must be a generated protocol buffer message in the open-struct API,where protobuf message fields are represented by exported Go struct fields.

Deprecated: Use protobuf reflection instead.

func (*StructProperties)Len

func (sp *StructProperties) Len()int

func (*StructProperties)Less

func (sp *StructProperties) Less(i, jint)bool

func (*StructProperties)Swap

func (sp *StructProperties) Swap(i, jint)

typeTextMarshaler

type TextMarshaler struct {Compactbool// use compact text format (one line)ExpandAnybool// expand google.protobuf.Any messages of known types}

TextMarshaler is a configurable text format marshaler.

func (*TextMarshaler)Marshal

func (tm *TextMarshaler) Marshal(wio.Writer, mMessage)error

Marshal writes the proto text format of m to w.

func (*TextMarshaler)Text

func (tm *TextMarshaler) Text(mMessage)string

Text returns a proto text formatted string of m.

typeUnmarshalerdeprecated

type Unmarshaler interface {// Unmarshal parses the encoded bytes of the protobuf wire input.// The provided buffer is only valid for during method call.// It should not reset the receiver message.Unmarshal([]byte)error}

Unmarshaler is implemented by messages that can unmarshal themselves.This interface is used by the following functions: Unmarshal, UnmarshalMerge,Buffer.Unmarshal, Buffer.DecodeMessage, and Buffer.DecodeGroup.

Deprecated: Do not implement.

typeXXX_InternalExtensionsdeprecated

type XXX_InternalExtensions =protoimpl.ExtensionFields

Deprecated: Do not use; this is an internal type.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp