當前位置: 首頁>>代碼示例>>Golang>>正文


Golang v1.EncodingBuffer類代碼示例

本文整理匯總了Golang中github.com/pquerna/ffjson/fflib/v1.EncodingBuffer的典型用法代碼示例。如果您正苦於以下問題:Golang EncodingBuffer類的具體用法?Golang EncodingBuffer怎麽用?Golang EncodingBuffer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了EncodingBuffer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的github.com/pquerna/ffjson/fflib/v1.EncodingBuffer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。