예제 #1
0
func (mj *TaskEvent) 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(`,"hostname":`)
	fflib.WriteJsonString(buf, string(mj.Hostname))
	buf.WriteString(`,"timestamp":`)
	fflib.AppendFloat(buf, float64(mj.Timestamp), 'g', -1, 32)
	buf.WriteString(`,"pid":`)
	fflib.FormatBits2(buf, uint64(mj.PID), 10, mj.PID < 0)
	buf.WriteString(`,"clock":`)
	fflib.FormatBits2(buf, uint64(mj.Clock), 10, mj.Clock < 0)
	buf.WriteString(`,"utcoffset":`)
	fflib.FormatBits2(buf, uint64(mj.UTCOffset), 10, mj.UTCOffset < 0)
	buf.WriteString(`,"uuid":`)
	fflib.WriteJsonString(buf, string(mj.UUID))
	buf.WriteString(`,"name":`)
	fflib.WriteJsonString(buf, string(mj.Name))
	buf.WriteString(`,"args":`)
	fflib.WriteJsonString(buf, string(mj.Args))
	buf.WriteString(`,"kwargs":`)
	fflib.WriteJsonString(buf, string(mj.Kwargs))
	buf.WriteString(`,"result":`)
	fflib.WriteJsonString(buf, string(mj.Result))
	buf.WriteString(`,"runtime":`)
	fflib.AppendFloat(buf, float64(mj.Runtime), 'g', -1, 32)
	buf.WriteString(`,"retries":`)
	fflib.FormatBits2(buf, uint64(mj.Retries), 10, mj.Retries < 0)
	buf.WriteString(`,"eta":`)
	fflib.FormatBits2(buf, uint64(mj.ETA), 10, mj.ETA < 0)
	buf.WriteString(`,"exception":`)
	fflib.WriteJsonString(buf, string(mj.Exception))
	buf.WriteString(`,"traceback":`)
	fflib.WriteJsonString(buf, string(mj.Traceback))
	if mj.Terminated {
		buf.WriteString(`,"terminated":true`)
	} else {
		buf.WriteString(`,"terminated":false`)
	}
	buf.WriteString(`,"signum":`)
	/* Interface types must use runtime reflection. type=interface {} kind=interface */
	err = buf.Encode(mj.Signum)
	if err != nil {
		return err
	}
	if mj.Expired {
		buf.WriteString(`,"expired":true`)
	} else {
		buf.WriteString(`,"expired":false`)
	}
	buf.WriteByte('}')
	return nil
}
예제 #2
0
func (mj *MtBroadCastMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"topics":`)
	if mj.Clients != nil {
		buf.WriteString(`[`)
		for i, v := range mj.Clients {
			if i != 0 {
				buf.WriteString(`,`)
			}
			fflib.WriteJsonString(buf, string(v))
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteString(`,"payload":`)
	fflib.WriteJsonString(buf, string(mj.Payload))
	buf.WriteByte('}')
	return nil
}
예제 #3
0
func (mj *Outfits) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"outfit_list":`)
	if mj.Outfits != nil {
		buf.WriteString(`[`)
		for i, v := range mj.Outfits {
			if i != 0 {
				buf.WriteString(`,`)
			}

			{

				err = v.MarshalJSONBuf(buf)
				if err != nil {
					return err
				}

			}
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteString(`,"error":`)
	fflib.WriteJsonString(buf, string(mj.Error))
	buf.WriteByte('}')
	return nil
}
예제 #4
0
func (mj *Outfit) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"outfit_id":`)
	fflib.WriteJsonString(buf, string(mj.ID))
	buf.WriteString(`,"name":`)
	fflib.WriteJsonString(buf, string(mj.Name))
	buf.WriteString(`,"name_lower":`)
	fflib.WriteJsonString(buf, string(mj.NameLower))
	buf.WriteString(`,"alias":`)
	fflib.WriteJsonString(buf, string(mj.Alias))
	buf.WriteString(`,"alias_lower":`)
	fflib.WriteJsonString(buf, string(mj.AliasLower))
	buf.WriteString(`,"time_created":`)
	fflib.WriteJsonString(buf, string(mj.TimeCreated))
	buf.WriteString(`,"leader_character_id":`)
	fflib.WriteJsonString(buf, string(mj.LeaderCharID))
	buf.WriteString(`,"member_count":`)
	fflib.WriteJsonString(buf, string(mj.MemberCount))
	buf.WriteByte('}')
	return nil
}
예제 #5
0
func (mj *Characters) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"character_list":`)
	if mj.Characters != nil {
		buf.WriteString(`[`)
		for i, v := range mj.Characters {
			if i != 0 {
				buf.WriteString(`,`)
			}

			{

				err = v.MarshalJSONBuf(buf)
				if err != nil {
					return err
				}

			}
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteByte('}')
	return nil
}
예제 #6
0
func (mj *User) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"name":`)
	fflib.WriteJsonString(buf, string(mj.Name))
	buf.WriteString(`,"color":`)
	fflib.WriteJsonString(buf, string(mj.Color))
	if mj.LoggedIn {
		buf.WriteString(`,"logged-in":true`)
	} else {
		buf.WriteString(`,"logged-in":false`)
	}
	/* Falling back. type=map[int]chat.voteOption kind=map */
	buf.WriteString(`,"voteMask":`)
	err = buf.Encode(mj.Votes)
	if err != nil {
		return err
	}
	buf.WriteByte('}')
	return nil
}
예제 #7
0
func (mj *EventStream) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"Err":`)
	/* Falling back. type=chan error kind=chan */
	err = buf.Encode(mj.Err)
	if err != nil {
		return err
	}
	buf.WriteString(`,"Events":`)
	/* Falling back. type=chan census.Event kind=chan */
	err = buf.Encode(mj.Events)
	if err != nil {
		return err
	}
	buf.WriteString(`,"Closed":`)
	/* Falling back. type=chan struct {} kind=chan */
	err = buf.Encode(mj.Closed)
	if err != nil {
		return err
	}
	buf.WriteByte('}')
	return nil
}
예제 #8
0
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
}
예제 #9
0
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
}
예제 #10
0
func (mj *ProcessList) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"AnyTypes":`)
	if mj.AnyTypes != nil {
		buf.WriteString(`[`)
		for i, v := range mj.AnyTypes {
			if i != 0 {
				buf.WriteString(`,`)
			}

			{

				err = v.MarshalJSONBuf(buf)
				if err != nil {
					return err
				}

			}
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteByte('}')
	return nil
}
예제 #11
0
func (mj *AgentRender) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"agent-type":`)
	fflib.WriteJsonString(buf, string(mj.Type))
	buf.WriteString(`,"position":`)

	{

		err = mj.Pos2D.MarshalJSONBuf(buf)
		if err != nil {
			return err
		}

	}
	buf.WriteString(`,"heading":`)
	fflib.AppendFloat(buf, float64(mj.Heading), 'g', -1, 64)
	/* Struct fall back. type=colour.RGB256 kind=struct */
	buf.WriteString(`,"colour":`)
	err = buf.Encode(&mj.Colour)
	if err != nil {
		return err
	}
	buf.WriteByte('}')
	return nil
}
예제 #12
0
파일: logger_ffjson.go 프로젝트: xinhp/libs
func (mj *LogFormat) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"Prefix":`)
	fflib.WriteJsonString(buf, string(mj.Prefix))
	buf.WriteString(`,"Time":`)

	{

		obj, err = mj.Time.MarshalJSON()
		if err != nil {
			return err
		}
		buf.Write(obj)

	}
	buf.WriteString(`,"Host":`)
	fflib.WriteJsonString(buf, string(mj.Host))
	buf.WriteString(`,"Level":`)
	fflib.FormatBits2(buf, uint64(mj.Level), 10, false)
	buf.WriteString(`,"Msg":`)
	fflib.WriteJsonString(buf, string(mj.Msg))
	buf.WriteString(`,"Caller":`)
	fflib.WriteJsonString(buf, string(mj.Caller))
	buf.WriteString(`,"LineNo":`)
	fflib.FormatBits2(buf, uint64(mj.LineNo), 10, mj.LineNo < 0)
	buf.WriteByte('}')
	return nil
}
예제 #13
0
func (mj *Entry) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	var err error
	var obj []byte
	var scratch fflib.FormatBitsScratch
	_ = scratch
	_ = obj
	_ = err
	buf.WriteString(`{ "manufacturer":`)
	fflib.WriteJsonString(buf, string(mj.Manufacturer))
	buf.WriteString(`,"address":`)
	if mj.Address != nil {
		buf.WriteString(`[`)
		for i, v := range mj.Address {
			if i != 0 {
				buf.WriteString(`,`)
			}
			fflib.WriteJsonString(buf, string(v))
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteString(`,"prefix":`)

	{
		obj, err = mj.Prefix.MarshalJSON()
		if err != nil {
			return err
		}
		buf.Write(obj)
	}

	buf.WriteByte(',')
	if len(mj.Country) != 0 {
		buf.WriteString(`"country":`)
		fflib.WriteJsonString(buf, string(mj.Country))
		buf.WriteByte(',')
	}
	if mj.Local != false {
		if mj.Local {
			buf.WriteString(`"local":true`)
		} else {
			buf.WriteString(`"local":false`)
		}
		buf.WriteByte(',')
	}
	if mj.Multicast != false {
		if mj.Multicast {
			buf.WriteString(`"multicast":true`)
		} else {
			buf.WriteString(`"multicast":false`)
		}
		buf.WriteByte(',')
	}
	buf.Rewind(1)
	buf.WriteByte('}')
	return nil
}
예제 #14
0
func (mj *Domain) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"Domain":`)
	fflib.WriteJsonString(buf, string(mj.Domain))
	buf.WriteByte('}')
	return nil
}
예제 #15
0
func (mj *Postal) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"Code":`)
	fflib.WriteJsonString(buf, string(mj.Code))
	buf.WriteByte('}')
	return nil
}
예제 #16
0
func (mj *EventSent) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"service":`)
	fflib.WriteJsonString(buf, string(mj.Service))
	buf.WriteString(`,"action":`)
	fflib.WriteJsonString(buf, string(mj.Action))
	buf.WriteString(`,"worlds":`)
	if mj.Worlds != nil {
		buf.WriteString(`[`)
		for i, v := range mj.Worlds {
			if i != 0 {
				buf.WriteString(`,`)
			}
			fflib.WriteJsonString(buf, string(v))
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteString(`,"characters":`)
	if mj.Characters != nil {
		buf.WriteString(`[`)
		for i, v := range mj.Characters {
			if i != 0 {
				buf.WriteString(`,`)
			}
			fflib.WriteJsonString(buf, string(v))
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteString(`,"eventNames":`)
	if mj.EventNames != nil {
		buf.WriteString(`[`)
		for i, v := range mj.EventNames {
			if i != 0 {
				buf.WriteString(`,`)
			}
			fflib.WriteJsonString(buf, string(v))
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteByte('}')
	return nil
}
예제 #17
0
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
}
예제 #18
0
func (mj *TCARD) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"UNITLINK":`)
	fflib.WriteJsonString(buf, string(mj.UNITLINK))
	buf.WriteString(`,"CARDIDEX":`)
	fflib.FormatBits2(buf, uint64(mj.CARDIDEX), 10, mj.CARDIDEX < 0)
	buf.WriteString(`,"CARDBDID":`)
	fflib.FormatBits2(buf, uint64(mj.CARDBDID), 10, mj.CARDBDID < 0)
	buf.WriteString(`,"CARDKJND":`)
	fflib.FormatBits2(buf, uint64(mj.CARDKJND), 10, mj.CARDKJND < 0)
	buf.WriteString(`,"CARDKJQJ":`)
	fflib.FormatBits2(buf, uint64(mj.CARDKJQJ), 10, mj.CARDKJQJ < 0)
	buf.WriteString(`,"DEPTLINK":`)
	fflib.WriteJsonString(buf, string(mj.DEPTLINK))
	buf.WriteString(`,"CARDYWBZ":`)
	fflib.FormatBits2(buf, uint64(mj.CARDYWBZ), 10, mj.CARDYWBZ < 0)
	buf.WriteString(`,"SORTTYPE":`)
	fflib.WriteJsonString(buf, string(mj.SORTTYPE))
	buf.WriteString(`,"SORTNAME":`)
	fflib.WriteJsonString(buf, string(mj.SORTNAME))
	buf.WriteString(`,"SORTLINK":`)
	fflib.WriteJsonString(buf, string(mj.SORTLINK))
	buf.WriteString(`,"ZCLBTYPE":`)
	fflib.WriteJsonString(buf, string(mj.ZCLBTYPE))
	buf.WriteString(`,"ZCLBNAME":`)
	fflib.WriteJsonString(buf, string(mj.ZCLBNAME))
	buf.WriteString(`,"ZCLBLINK":`)
	fflib.WriteJsonString(buf, string(mj.ZCLBLINK))
	buf.WriteString(`,"CARDNAME":`)
	fflib.WriteJsonString(buf, string(mj.CARDNAME))
	buf.WriteString(`,"CARDZJNX":`)
	fflib.FormatBits2(buf, uint64(mj.CARDZJNX), 10, mj.CARDZJNX < 0)
	buf.WriteString(`,"CARDZJFF":`)
	fflib.WriteJsonString(buf, string(mj.CARDZJFF))
	buf.WriteString(`,"CARDZJZT":`)
	fflib.WriteJsonString(buf, string(mj.CARDZJZT))
	buf.WriteString(`,"CARDCODE":`)
	fflib.WriteJsonString(buf, string(mj.CARDCODE))
	buf.WriteString(`,"CARDJLDW":`)
	fflib.WriteJsonString(buf, string(mj.CARDJLDW))
	buf.WriteString(`,"CARDGGXH":`)
	fflib.WriteJsonString(buf, string(mj.CARDGGXH))
	buf.WriteByte('}')
	return nil
}
예제 #19
0
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
}
예제 #20
0
func (mj *Error) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{ "error":`)
	fflib.WriteJsonString(buf, string(mj.Code))
	buf.WriteByte(',')
	if len(mj.Description) != 0 {
		buf.WriteString(`"error_description":`)
		fflib.WriteJsonString(buf, string(mj.Description))
		buf.WriteByte(',')
	}
	if len(mj.URI) != 0 {
		buf.WriteString(`"error_uri":`)
		fflib.WriteJsonString(buf, string(mj.URI))
		buf.WriteByte(',')
	}
	buf.Rewind(1)
	buf.WriteByte('}')
	return nil
}
예제 #21
0
func (mj *WorkerEvent) 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(`,"hostname":`)
	fflib.WriteJsonString(buf, string(mj.Hostname))
	buf.WriteString(`,"timestamp":`)
	fflib.AppendFloat(buf, float64(mj.Timestamp), 'g', -1, 32)
	buf.WriteString(`,"pid":`)
	fflib.FormatBits2(buf, uint64(mj.PID), 10, mj.PID < 0)
	buf.WriteString(`,"clock":`)
	fflib.FormatBits2(buf, uint64(mj.Clock), 10, mj.Clock < 0)
	buf.WriteString(`,"utcoffset":`)
	fflib.FormatBits2(buf, uint64(mj.UTCOffset), 10, mj.UTCOffset < 0)
	buf.WriteString(`,"sw_sys":`)
	fflib.WriteJsonString(buf, string(mj.SWSystem))
	buf.WriteString(`,"sw_ver":`)
	fflib.WriteJsonString(buf, string(mj.SWVersion))
	buf.WriteString(`,"loadavg":`)
	if mj.LoadAverage != nil {
		buf.WriteString(`[`)
		for i, v := range mj.LoadAverage {
			if i != 0 {
				buf.WriteString(`,`)
			}
			fflib.AppendFloat(buf, float64(v), 'g', -1, 32)
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteString(`,"freq":`)
	fflib.AppendFloat(buf, float64(mj.Freq), 'g', -1, 32)
	buf.WriteString(`,"sw_ident":`)
	fflib.WriteJsonString(buf, string(mj.SWIdentity))
	buf.WriteString(`,"processed":`)
	fflib.FormatBits2(buf, uint64(mj.Processed), 10, mj.Processed < 0)
	buf.WriteString(`,"active":`)
	fflib.FormatBits2(buf, uint64(mj.Active), 10, mj.Active < 0)
	buf.WriteByte('}')
	return nil
}
예제 #22
0
파일: json_ffjson.go 프로젝트: pmezard/apec
func (mj *Location) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	if mj.Cached {
		buf.WriteString(`{"Cached":true`)
	} else {
		buf.WriteString(`{"Cached":false`)
	}
	buf.WriteString(`,"rate":`)

	{

		err = mj.Rate.MarshalJSONBuf(buf)
		if err != nil {
			return err
		}

	}
	buf.WriteString(`,"results":`)
	if mj.Results != nil {
		buf.WriteString(`[`)
		for i, v := range mj.Results {
			if i != 0 {
				buf.WriteString(`,`)
			}

			{

				err = v.MarshalJSONBuf(buf)
				if err != nil {
					return err
				}

			}
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteByte('}')
	return nil
}
예제 #23
0
func (mj *Pos2D) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"x":`)
	fflib.AppendFloat(buf, float64(mj.X), 'g', -1, 64)
	buf.WriteString(`,"y":`)
	fflib.AppendFloat(buf, float64(mj.Y), 'g', -1, 64)
	buf.WriteByte('}')
	return nil
}
예제 #24
0
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
}
예제 #25
0
파일: json_ffjson.go 프로젝트: pmezard/apec
func (mj *LocRate) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"limit":`)
	fflib.FormatBits2(buf, uint64(mj.Limit), 10, mj.Limit < 0)
	buf.WriteString(`,"remaining":`)
	fflib.FormatBits2(buf, uint64(mj.Remaining), 10, mj.Remaining < 0)
	buf.WriteByte('}')
	return nil
}
예제 #26
0
파일: json_ffjson.go 프로젝트: pmezard/apec
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
}
예제 #27
0
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
}
예제 #28
0
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
}
예제 #29
0
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
}
예제 #30
0
파일: json_ffjson.go 프로젝트: pmezard/apec
func (mj *JsonOffer) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if mj == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"numeroOffre":`)
	fflib.WriteJsonString(buf, string(mj.Id))
	buf.WriteString(`,"intitule":`)
	fflib.WriteJsonString(buf, string(mj.Title))
	buf.WriteString(`,"datePublication":`)
	fflib.WriteJsonString(buf, string(mj.Date))
	buf.WriteString(`,"salaireTexte":`)
	fflib.WriteJsonString(buf, string(mj.Salary))
	if mj.PartialTime {
		buf.WriteString(`,"tempsPartiel":true`)
	} else {
		buf.WriteString(`,"tempsPartiel":false`)
	}
	buf.WriteString(`,"lieuTexte":`)
	fflib.WriteJsonString(buf, string(mj.Location))
	buf.WriteString(`,"lieux":`)
	if mj.Locations != nil {
		buf.WriteString(`[`)
		for i, v := range mj.Locations {
			if i != 0 {
				buf.WriteString(`,`)
			}
			/* Inline struct. type=struct { Name string "json:\"libelleLieu\"" } kind=struct */
			buf.WriteString(`{ "libelleLieu":`)
			fflib.WriteJsonString(buf, string(v.Name))
			buf.WriteByte('}')
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteString(`,"texteHtml":`)
	fflib.WriteJsonString(buf, string(mj.HTML))
	buf.WriteString(`,"nomCompteEtablissement":`)
	fflib.WriteJsonString(buf, string(mj.Account))
	buf.WriteByte('}')
	return nil
}