本文整理汇总了Golang中github.com/pquerna/ffjson/fflib/v1.EncodingBuffer类的典型用法代码示例。如果您正苦于以下问题:Golang EncodingBuffer类的具体用法?Golang EncodingBuffer怎么用?Golang EncodingBuffer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EncodingBuffer类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: MarshalJSONBuf
func (mj *Event) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"Payload":`)
{
err = mj.Payload.MarshalJSONBuf(buf)
if err != nil {
return err
}
}
buf.WriteString(`,"service":`)
fflib.WriteJsonString(buf, string(mj.Service))
buf.WriteString(`,"type":`)
fflib.WriteJsonString(buf, string(mj.Type))
buf.WriteByte('}')
return nil
}
开发者ID:THUNDERGROOVE,项目名称:census,代码行数:26,代码来源:event_stream_ffjson.go
示例2: MarshalJSONBuf
func (mj *InMsg) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"type":`)
fflib.WriteJsonString(buf, string(mj.Type))
buf.WriteString(`,"data":`)
{
obj, err = mj.Data.MarshalJSON()
if err != nil {
return err
}
buf.Write(obj)
}
buf.WriteByte('}')
return nil
}
开发者ID:benjamin-rood,项目名称:gobr,代码行数:25,代码来源:json-types_ffjson.go
示例3: MarshalJSONBuf
func (mj *Reader) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{}`)
return nil
}
开发者ID:wheelcomplex,项目名称:geoip-service,代码行数:8,代码来源:reader_ffjson.go
示例4: MarshalJSONBuf
func (mj *Person) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{}`)
return nil
}
开发者ID:cch123,项目名称:test,代码行数:12,代码来源:ffjs_ffjson.go
示例5: MarshalJSONBuf
func (mj *RGB) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"red":`)
fflib.AppendFloat(buf, float64(mj.Red), 'g', -1, 64)
buf.WriteString(`,"green":`)
fflib.AppendFloat(buf, float64(mj.Green), 'g', -1, 64)
buf.WriteString(`,"blue":`)
fflib.AppendFloat(buf, float64(mj.Blue), 'g', -1, 64)
buf.WriteByte('}')
return nil
}
开发者ID:benjamin-rood,项目名称:abm-cp,代码行数:18,代码来源:colour_ffjson.go
示例6: MarshalJSONBuf
func (mj *LocGeom) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"lat":`)
fflib.AppendFloat(buf, float64(mj.Lat), 'g', -1, 64)
buf.WriteString(`,"lng":`)
fflib.AppendFloat(buf, float64(mj.Lon), 'g', -1, 64)
buf.WriteByte('}')
return nil
}
开发者ID:pmezard,项目名称:apec,代码行数:16,代码来源:json_ffjson.go
示例7: MarshalJSONBuf
func (mj *BadgeMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"Data":`)
fflib.FormatBits2(buf, uint64(mj.Data), 10, mj.Data < 0)
buf.WriteString(`,"Type":`)
fflib.WriteJsonString(buf, string(mj.Type))
buf.WriteByte('}')
return nil
}
开发者ID:nagae-memooff,项目名称:surgemq,代码行数:16,代码来源:process_ffjson.go
示例8: MarshalJSONBuf
func (mj *Router) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"mac":`)
fflib.WriteJsonString(buf, string(mj.Mac))
buf.WriteString(`,"rssi":`)
fflib.FormatBits2(buf, uint64(mj.Rssi), 10, mj.Rssi < 0)
buf.WriteByte('}')
return nil
}
开发者ID:schollz,项目名称:find,代码行数:16,代码来源:fingerprint_ffjson.go
示例9: MarshalJSONBuf
func (mj *LogoInfo) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"Path":`)
fflib.WriteJsonString(buf, string(mj.Path))
buf.WriteString(`,"Name":`)
fflib.WriteJsonString(buf, string(mj.Name))
buf.WriteByte('}')
return nil
}
开发者ID:chenbk85,项目名称:nephele,代码行数:16,代码来源:logoinfo_ffjson.go
示例10: MarshalJSONBuf
func (mj *Viewport) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"width":`)
fflib.AppendFloat(buf, float64(mj.Width), 'g', -1, 64)
buf.WriteString(`,"height":`)
fflib.AppendFloat(buf, float64(mj.Height), 'g', -1, 64)
buf.WriteByte('}')
return nil
}
开发者ID:benjamin-rood,项目名称:abm-cp,代码行数:16,代码来源:render_ffjson.go
示例11: MarshalJSONBuf
func (mj *Server) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
/* Falling back. type=map[int]*chat.Topic kind=map */
buf.WriteString(`{"users":`)
err = buf.Encode(mj.Topics)
if err != nil {
return err
}
buf.WriteByte('}')
return nil
}
开发者ID:strawmang,项目名称:strawmang,代码行数:18,代码来源:ffjson_chat.go
示例12: MarshalJSONBuf
func (mj *StatsOutput) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"total":`)
fflib.FormatBits2(buf, uint64(mj.Total), 10, false)
buf.WriteString(`,"verified":`)
fflib.FormatBits2(buf, uint64(mj.Verified), 10, false)
buf.WriteByte('}')
return nil
}
开发者ID:GeenPeil,项目名称:teken,代码行数:12,代码来源:outputtypes_ffjson.go
示例13: MarshalJSONBuf
func (mj *Backend) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"Type":`)
fflib.WriteJsonString(buf, string(mj.Type))
buf.WriteByte('}')
return nil
}
开发者ID:christian-blades-cb,项目名称:desoto,代码行数:14,代码来源:vulcand_ffjson.go
示例14: MarshalJSONBuf
func (mj *ServiceDefinition) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"type":`)
fflib.WriteJsonString(buf, string(mj.Type))
buf.WriteString(`,"container_port":`)
fflib.FormatBits2(buf, uint64(mj.ContainerPort), 10, mj.ContainerPort < 0)
if mj.NamePattern != nil {
buf.WriteString(`,"name_pattern":`)
fflib.WriteJsonString(buf, string(*mj.NamePattern))
} else {
buf.WriteString(`,"name_pattern":null`)
}
buf.WriteByte('}')
return nil
}
开发者ID:christian-blades-cb,项目名称:desoto,代码行数:22,代码来源:servicedef_ffjson.go
示例15: MarshalJSONBuf
func (mj *ResponseCountry) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{ `)
if mj.Data != nil {
if true {
buf.WriteString(`"Data":`)
{
err = mj.Data.MarshalJSONBuf(buf)
if err != nil {
return err
}
}
buf.WriteByte(',')
}
}
if len(mj.Error) != 0 {
buf.WriteString(`"Error":`)
fflib.WriteJsonString(buf, string(mj.Error))
buf.WriteByte(',')
}
buf.Rewind(1)
buf.WriteByte('}')
return nil
}
开发者ID:wheelcomplex,项目名称:geoip-service,代码行数:29,代码来源:geoip_ffjson.go
示例16: MarshalJSONBuf
func (mj *BroIPFields) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
if mj == nil {
buf.WriteString("null")
return nil
}
var err error
var obj []byte
_ = obj
_ = err
buf.WriteString(`{"id.orig_h":`)
fflib.WriteJsonString(buf, string(mj.ID_orig_h))
buf.WriteString(`,"id.resp_h":`)
fflib.WriteJsonString(buf, string(mj.ID_resp_h))
buf.WriteString(`,"src":`)
fflib.WriteJsonString(buf, string(mj.Src))
buf.WriteString(`,"dst":`)
fflib.WriteJsonString(buf, string(mj.Dst))
buf.WriteByte('}')
return nil
}
开发者ID:JustinAzoff,项目名称:flow-indexer,代码行数:20,代码来源:bro_json_ffjson.go
注:本文中的github.com/pquerna/ffjson/fflib/v1.EncodingBuffer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论