当前位置: 首页>>代码示例>>Golang>>正文


Golang Lexer.String方法代码示例

本文整理汇总了Golang中github.com/mailru/easyjson/jlexer.Lexer.String方法的典型用法代码示例。如果您正苦于以下问题:Golang Lexer.String方法的具体用法?Golang Lexer.String怎么用?Golang Lexer.String使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/mailru/easyjson/jlexer.Lexer的用法示例。


在下文中一共展示了Lexer.String方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: easyjson_decode_finance_provider_yahoo_Result

func easyjson_decode_finance_provider_yahoo_Result(in *jlexer.Lexer, out *Result) {
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "count":
			out.Count = in.Int()
		case "created":
			out.Created = in.String()
		case "lang":
			out.Lang = in.String()
		case "results":
			(out.Results).UnmarshalEasyJSON(in)
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
}
开发者ID:gobwas,项目名称:kursobot,代码行数:26,代码来源:types_easyjson.go

示例2: easyjson_decode_go_serialization_benchmarks_A

func easyjson_decode_go_serialization_benchmarks_A(in *jlexer.Lexer, out *A) {
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "Name":
			out.Name = in.String()
		case "BirthDay":
			if data := in.Raw(); in.Ok() {
				in.AddError((out.BirthDay).UnmarshalJSON(data))
			}
		case "Phone":
			out.Phone = in.String()
		case "Siblings":
			out.Siblings = in.Int()
		case "Spouse":
			out.Spouse = in.Bool()
		case "Money":
			out.Money = in.Float64()
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
}
开发者ID:alecthomas,项目名称:go_serialization_benchmarks,代码行数:32,代码来源:structdef_easyjson.go

示例3: UnmarshalEasyJSON

// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
func (v *String) UnmarshalEasyJSON(l *jlexer.Lexer) {
	if l.IsNull() {
		l.Skip()
		*v = String{}
	} else {
		v.V = l.String()
		v.Defined = true
	}
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例4: UnmarshalEasyJSON

func (d *Duration) UnmarshalEasyJSON(in *jlexer.Lexer) {
	if data := in.String(); in.Ok() {
		tt, err := ParseDuration(data)
		if err != nil {
			in.AddError(err)
			return
		}
		*d = Duration(tt)
	}
}
开发者ID:Cl0udPhish,项目名称:go-swagger,代码行数:10,代码来源:duration.go

示例5: UnmarshalEasyJSON

func (t *DateTime) UnmarshalEasyJSON(in *jlexer.Lexer) {
	if data := in.String(); in.Ok() {
		tt, err := ParseDateTime(data)
		if err != nil {
			in.AddError(err)
			return
		}
		*t = tt
	}
}
开发者ID:Cl0udPhish,项目名称:go-swagger,代码行数:10,代码来源:time.go

示例6: UnmarshalEasyJSON

func (t *Date) UnmarshalEasyJSON(in *jlexer.Lexer) {
	if data := in.String(); in.Ok() {
		tt, err := time.Parse(RFC3339FullDate, data)
		if err != nil {
			in.AddError(err)
			return
		}
		*t = Date(tt)
	}
}
开发者ID:Cl0udPhish,项目名称:go-swagger,代码行数:10,代码来源:date.go

示例7: UnmarshalEasyJSON

func (b *Base64) UnmarshalEasyJSON(in *jlexer.Lexer) {
	if data := in.String(); in.Ok() {
		enc := base64.StdEncoding
		dbuf := make([]byte, enc.DecodedLen(len(data)))

		n, err := enc.Decode(dbuf, []byte(data))
		if err != nil {
			in.AddError(err)
			return
		}

		*b = dbuf[:n]
	}
}
开发者ID:Cl0udPhish,项目名称:go-swagger,代码行数:14,代码来源:default.go

示例8: easyjson_decode_github_com_buger_jsonparser_benchmark_MediumPayload

func easyjson_decode_github_com_buger_jsonparser_benchmark_MediumPayload(in *jlexer.Lexer, out *MediumPayload) {
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "person":
			if in.IsNull() {
				in.Skip()
				out.Person = nil
			} else {
				out.Person = new(CBPerson)
				(*out.Person).UnmarshalEasyJSON(in)
			}
		case "company":
			in.Delim('{')
			if !in.IsDelim('}') {
				out.Company = make(map[string]interface{})
			} else {
				out.Company = nil
			}
			for !in.IsDelim('}') {
				key := in.String()
				in.WantColon()
				var v7 interface{}
				v7 = in.Interface()
				(out.Company)[key] = v7
				in.WantComma()
			}
			in.Delim('}')
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
}
开发者ID:qband,项目名称:down,代码行数:42,代码来源:benchmark_easyjson.go

示例9: easyjson7f5ba663DecodeGithubComSergeiSvistunovGorpcDebug

func easyjson7f5ba663DecodeGithubComSergeiSvistunovGorpcDebug(in *jlexer.Lexer, out *debug.Debug) {
	if in.IsNull() {
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "modules":
			if in.IsNull() {
				in.Skip()
			} else {
				in.Delim('{')
				if !in.IsDelim('}') {
					out.Modules = make(map[string]interface{})
				} else {
					out.Modules = nil
				}
				for !in.IsDelim('}') {
					key := string(in.String())
					in.WantColon()
					var v1 interface{}
					v1 = in.Interface()
					(out.Modules)[key] = v1
					in.WantComma()
				}
				in.Delim('}')
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
}
开发者ID:sergei-svistunov,项目名称:gorpc,代码行数:42,代码来源:http_json_easyjson.go

示例10: easyjson_decode_github_com_buger_jsonparser_benchmark_CBAvatar

func easyjson_decode_github_com_buger_jsonparser_benchmark_CBAvatar(in *jlexer.Lexer, out *CBAvatar) {
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "url":
			out.Url = in.String()
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
}
开发者ID:qband,项目名称:down,代码行数:20,代码来源:benchmark_easyjson.go

示例11: easyjson_decode_github_com_buger_jsonparser_benchmark_DSTopicsList

func easyjson_decode_github_com_buger_jsonparser_benchmark_DSTopicsList(in *jlexer.Lexer, out *DSTopicsList) {
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "topics":
			in.Delim('[')
			if !in.IsDelim(']') {
				out.Topics = make([]*DSTopic, 0, 8)
			} else {
				out.Topics = nil
			}
			for !in.IsDelim(']') {
				var v4 *DSTopic
				if in.IsNull() {
					in.Skip()
					v4 = nil
				} else {
					v4 = new(DSTopic)
					(*v4).UnmarshalEasyJSON(in)
				}
				out.Topics = append(out.Topics, v4)
				in.WantComma()
			}
			in.Delim(']')
		case "more_topics_url":
			out.MoreTopicsUrl = in.String()
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
}
开发者ID:qband,项目名称:down,代码行数:40,代码来源:benchmark_easyjson.go

示例12: easyjson_decode_github_com_dimiro1_experiments_easyjson_Person

func easyjson_decode_github_com_dimiro1_experiments_easyjson_Person(in *jlexer.Lexer, out *Person) {
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "name":
			out.Name = in.String()
		case "age":
			out.Age = in.Int()
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
}
开发者ID:dimiro1,项目名称:experiments,代码行数:22,代码来源:easyjson_easyjson.go

示例13: easyjson_decode_github_com_buger_jsonparser_benchmark_DSTopic

func easyjson_decode_github_com_buger_jsonparser_benchmark_DSTopic(in *jlexer.Lexer, out *DSTopic) {
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "id":
			out.Id = in.Int()
		case "slug":
			out.Slug = in.String()
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
}
开发者ID:qband,项目名称:down,代码行数:22,代码来源:benchmark_easyjson.go

示例14: easyjson7f5ba663DecodeGithubComSergeiSvistunovGorpcTransportHttpJson

func easyjson7f5ba663DecodeGithubComSergeiSvistunovGorpcTransportHttpJson(in *jlexer.Lexer, out *httpSessionResponse) {
	if in.IsNull() {
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "result":
			out.Result = string(in.String())
		case "data":
			out.Data = in.Interface()
		case "error":
			out.Error = string(in.String())
		case "debug":
			if in.IsNull() {
				in.Skip()
				out.Debug = nil
			} else {
				if out.Debug == nil {
					out.Debug = new(debug.Debug)
				}
				easyjson7f5ba663DecodeGithubComSergeiSvistunovGorpcDebug(in, &*out.Debug)
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
}
开发者ID:sergei-svistunov,项目名称:gorpc,代码行数:38,代码来源:http_json_easyjson.go

示例15: easyjson_decode_github_com_buger_jsonparser_benchmark_SmallPayload

func easyjson_decode_github_com_buger_jsonparser_benchmark_SmallPayload(in *jlexer.Lexer, out *SmallPayload) {
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "st":
			out.St = in.Int()
		case "sid":
			out.Sid = in.Int()
		case "tt":
			out.Tt = in.String()
		case "gr":
			out.Gr = in.Int()
		case "uuid":
			out.Uuid = in.String()
		case "ip":
			out.Ip = in.String()
		case "ua":
			out.Ua = in.String()
		case "tz":
			out.Tz = in.Int()
		case "v":
			out.V = in.Int()
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
}
开发者ID:qband,项目名称:down,代码行数:36,代码来源:benchmark_easyjson.go


注:本文中的github.com/mailru/easyjson/jlexer.Lexer.String方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。