コード例 #1
0
ファイル: benchmark_easyjson.go プロジェクト: qband/down
func easyjson_encode_github_com_buger_jsonparser_benchmark_DSTopicsList(out *jwriter.Writer, in *DSTopicsList) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"topics\":")
	out.RawByte('[')
	for v5, v6 := range in.Topics {
		if v5 > 0 {
			out.RawByte(',')
		}
		if v6 == nil {
			out.RawString("null")
		} else {
			(*v6).MarshalEasyJSON(out)
		}
	}
	out.RawByte(']')
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"more_topics_url\":")
	out.String(in.MoreTopicsUrl)
	out.RawByte('}')
}
コード例 #2
0
ファイル: benchmark_easyjson.go プロジェクト: qband/down
func easyjson_encode_github_com_buger_jsonparser_benchmark_MediumPayload(out *jwriter.Writer, in *MediumPayload) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"person\":")
	if in.Person == nil {
		out.RawString("null")
	} else {
		(*in.Person).MarshalEasyJSON(out)
	}
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"company\":")
	out.RawByte('{')
	v8_first := true
	for v8_name, v8_value := range in.Company {
		if !v8_first {
			out.RawByte(',')
		}
		v8_first = false
		out.String(v8_name)
		out.Raw(json.Marshal(v8_value))
	}
	out.RawByte('}')
	out.RawByte('}')
}
コード例 #3
0
func easyjson7f5ba663EncodeGithubComSergeiSvistunovGorpcDebug(out *jwriter.Writer, in debug.Debug) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"modules\":")
	if in.Modules == nil {
		out.RawString(`null`)
	} else {
		out.RawByte('{')
		v2First := true
		for v2Name, v2Value := range in.Modules {
			if !v2First {
				out.RawByte(',')
			}
			v2First = false
			out.String(string(v2Name))
			out.RawByte(':')
			out.Raw(json.Marshal(v2Value))
		}
		out.RawByte('}')
	}
	out.RawByte('}')
}
コード例 #4
0
// MarshalEasyJSON does JSON marshaling using easyjson interface.
func (v String) MarshalEasyJSON(w *jwriter.Writer) {
	if v.Defined {
		w.String(v.V)
	} else {
		w.RawString("null")
	}
}
コード例 #5
0
ファイル: types_easyjson.go プロジェクト: gobwas/kursobot
func easyjson_encode_finance_provider_yahoo_Result(out *jwriter.Writer, in *Result) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"count\":")
	out.Int(in.Count)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"created\":")
	out.String(in.Created)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"lang\":")
	out.String(in.Lang)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"results\":")
	(in.Results).MarshalEasyJSON(out)
	out.RawByte('}')
}
コード例 #6
0
ファイル: benchmark_easyjson.go プロジェクト: qband/down
func easyjson_encode_github_com_buger_jsonparser_benchmark_CBAvatar(out *jwriter.Writer, in *CBAvatar) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"url\":")
	out.String(in.Url)
	out.RawByte('}')
}
コード例 #7
0
ファイル: benchmark_easyjson.go プロジェクト: qband/down
func easyjson_encode_github_com_buger_jsonparser_benchmark_CBName(out *jwriter.Writer, in *CBName) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"full_name\":")
	out.String(in.FullName)
	out.RawByte('}')
}
コード例 #8
0
ファイル: benchmark_easyjson.go プロジェクト: qband/down
func easyjson_encode_github_com_buger_jsonparser_benchmark_DSUser(out *jwriter.Writer, in *DSUser) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"username\":")
	out.String(in.Username)
	out.RawByte('}')
}
コード例 #9
0
ファイル: benchmark_easyjson.go プロジェクト: qband/down
func easyjson_encode_github_com_buger_jsonparser_benchmark_SmallPayload(out *jwriter.Writer, in *SmallPayload) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"st\":")
	out.Int(in.St)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"sid\":")
	out.Int(in.Sid)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"tt\":")
	out.String(in.Tt)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"gr\":")
	out.Int(in.Gr)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"uuid\":")
	out.String(in.Uuid)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"ip\":")
	out.String(in.Ip)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"ua\":")
	out.String(in.Ua)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"tz\":")
	out.Int(in.Tz)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"v\":")
	out.Int(in.V)
	out.RawByte('}')
}
コード例 #10
0
ファイル: benchmark_easyjson.go プロジェクト: qband/down
func easyjson_encode_github_com_buger_jsonparser_benchmark_DSTopic(out *jwriter.Writer, in *DSTopic) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"id\":")
	out.Int(in.Id)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"slug\":")
	out.String(in.Slug)
	out.RawByte('}')
}
コード例 #11
0
func easyjson_encode_github_com_dimiro1_experiments_easyjson_Person(out *jwriter.Writer, in *Person) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"name\":")
	out.String(in.Name)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"age\":")
	out.Int(in.Age)
	out.RawByte('}')
}
コード例 #12
0
func easyjson_encode_go_serialization_benchmarks_A(out *jwriter.Writer, in *A) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Name\":")
	out.String(in.Name)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"BirthDay\":")
	out.Raw((in.BirthDay).MarshalJSON())
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Phone\":")
	out.String(in.Phone)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Siblings\":")
	out.Int(in.Siblings)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Spouse\":")
	out.Bool(in.Spouse)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Money\":")
	out.Float64(in.Money)
	out.RawByte('}')
}
コード例 #13
0
func easyjson7f5ba663EncodeGithubComSergeiSvistunovGorpcTransportHttpJson(out *jwriter.Writer, in httpSessionResponse) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"result\":")
	out.String(string(in.Result))
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"data\":")
	if d, ok := in.Data.(json.Marshaler); ok {
		out.Raw(d.MarshalJSON())
	} else {
		out.Raw(json.Marshal(in.Data))
	}
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"error\":")
	out.String(string(in.Error))
	if in.Debug != nil {
		if !first {
			out.RawByte(',')
		}
		first = false
		out.RawString("\"debug\":")
		if in.Debug == nil {
			out.RawString("null")
		} else {
			easyjson7f5ba663EncodeGithubComSergeiSvistunovGorpcDebug(out, *in.Debug)
		}
	}
	out.RawByte('}')
}
コード例 #14
0
ファイル: date.go プロジェクト: Cl0udPhish/go-swagger
func (t Date) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(time.Time(t).Format(RFC3339FullDate))
}
コード例 #15
0
ファイル: default.go プロジェクト: Cl0udPhish/go-swagger
func (u ISBN10) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(string(u))
}
コード例 #16
0
ファイル: default.go プロジェクト: Cl0udPhish/go-swagger
func (u UUID5) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(string(u))
}
コード例 #17
0
ファイル: default.go プロジェクト: Cl0udPhish/go-swagger
func (h Hostname) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(string(h))
}
コード例 #18
0
ファイル: default.go プロジェクト: Cl0udPhish/go-swagger
func (e Email) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(string(e))
}
コード例 #19
0
ファイル: default.go プロジェクト: Cl0udPhish/go-swagger
func (b Base64) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(base64.StdEncoding.EncodeToString([]byte(b)))
}
コード例 #20
0
ファイル: default.go プロジェクト: Cl0udPhish/go-swagger
func (r Password) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(string(r))
}
コード例 #21
0
ファイル: default.go プロジェクト: Cl0udPhish/go-swagger
func (r RGBColor) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(string(r))
}
コード例 #22
0
ファイル: default.go プロジェクト: Cl0udPhish/go-swagger
func (h HexColor) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(string(h))
}
コード例 #23
0
ファイル: default.go プロジェクト: Cl0udPhish/go-swagger
func (u CreditCard) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(string(u))
}
コード例 #24
0
ファイル: types_easyjson.go プロジェクト: gobwas/kursobot
func easyjson_encode_finance_provider_yahoo_YahooRate(out *jwriter.Writer, in *YahooRate) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"id\":")
	out.String(in.Id)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Name\":")
	out.String(in.Name)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Rate\":")
	out.String(in.Rate)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Date\":")
	out.String(in.Date)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Time\":")
	out.String(in.Time)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Ask\":")
	out.String(in.Ask)
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"Bid\":")
	out.String(in.Bid)
	out.RawByte('}')
}
コード例 #25
0
ファイル: duration.go プロジェクト: Cl0udPhish/go-swagger
func (d Duration) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(time.Duration(d).String())
}
コード例 #26
0
ファイル: time.go プロジェクト: Cl0udPhish/go-swagger
func (t DateTime) MarshalEasyJSON(w *jwriter.Writer) {
	w.String(time.Time(t).Format(RFC3339Millis))
}