Documentation
¶
Index ¶
- Constants
- func Marshal(m proto.Message) ([]byte, error)
- type Encoder
- func (e *Encoder) Bytes() []byte
- func (e *Encoder) EndArray()
- func (e *Encoder) EndObject()
- func (e *Encoder) EndString()
- func (e *Encoder) StartArray()
- func (e *Encoder) StartObject()
- func (e *Encoder) StartString()
- func (e *Encoder) WriteBool(b bool)
- func (e *Encoder) WriteIndexedList(i int)
- func (e *Encoder) WriteInt(n int64)
- func (e *Encoder) WriteKey(s string) error
- func (e *Encoder) WriteNull()
- func (e *Encoder) WriteNumber(number string)
- func (e *Encoder) WriteString(s string) error
- func (e *Encoder) WriteUint(n uint64)
- type EncodingRun
- type JsonName
- type LuaMarshalOption
- type MarshalFunc
- type ProtobufName
Constants ¶
View Source
const ArrayClose = "}"
View Source
const ArrayOpen = "{"
View Source
const BeginString = "\""
View Source
const BoolFalse = "false"
View Source
const BoolTrue = "true"
View Source
const DefaultIndent = " "
View Source
const EndString = "\""
View Source
const GoogleProtobufParentPackage = "google.protobuf"
View Source
const GoogleProtobufTimestamp = "Timestamp"
View Source
const KeyAssign = "="
View Source
const NullValue = "nil"
View Source
const TableClose = "}"
View Source
const TableOpen = "{"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func (*Encoder) StartArray ¶
func (e *Encoder) StartArray()
func (*Encoder) StartObject ¶
func (e *Encoder) StartObject()
func (*Encoder) StartString ¶
func (e *Encoder) StartString()
func (*Encoder) WriteIndexedList ¶
func (*Encoder) WriteNumber ¶
func (*Encoder) WriteString ¶
WriteString escaped the string according to rules needed for luatex
type EncodingRun ¶
type EncodingRun struct { *Encoder // contains filtered or unexported fields }
type JsonName ¶
type JsonName struct { }
default for KeyName, will use the jsonName for keys. Except for the root messages where the json name can not be extracted.
type LuaMarshalOption ¶
type LuaMarshalOption struct { Format struct { // If set to false the lua table with be outputed in one line (default) // If set to true the lua table with be outputed in multiple line (better for humans) Multiline bool } // If set to nil, jsonName will be used KeyName interface { // contains filtered or unexported methods } // Marshalers for none standard proto messages AdditionalMarshalers []interface { Handle(fullName protoreflect.FullName) (MarshalFunc, error) } }
type MarshalFunc ¶
type MarshalFunc func(EncodingRun, protoreflect.Message) error
Click to show internal directories.
Click to hide internal directories.