summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/bulk_index_request_easyjson.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/bulk_index_request_easyjson.go')
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/bulk_index_request_easyjson.go66
1 files changed, 39 insertions, 27 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/bulk_index_request_easyjson.go b/vendor/gopkg.in/olivere/elastic.v5/bulk_index_request_easyjson.go
index f8792978f..6ee19fbec 100644
--- a/vendor/gopkg.in/olivere/elastic.v5/bulk_index_request_easyjson.go
+++ b/vendor/gopkg.in/olivere/elastic.v5/bulk_index_request_easyjson.go
@@ -17,7 +17,7 @@ var (
_ easyjson.Marshaler
)
-func easyjson9de0fcbfDecodeGithubComOlivereElastic(in *jlexer.Lexer, out *bulkIndexRequestCommandOp) {
+func easyjson9de0fcbfDecodeGopkgInOlivereElasticV5(in *jlexer.Lexer, out *bulkIndexRequestCommandOp) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -36,15 +36,17 @@ func easyjson9de0fcbfDecodeGithubComOlivereElastic(in *jlexer.Lexer, out *bulkIn
continue
}
switch key {
- case "_index":
- out.Index = string(in.String())
case "_id":
out.Id = string(in.String())
+ case "_index":
+ out.Index = string(in.String())
+ case "_ttl":
+ out.TTL = string(in.String())
case "_type":
out.Type = string(in.String())
- case "parent":
+ case "_parent":
out.Parent = string(in.String())
- case "retry_on_conflict":
+ case "_retry_on_conflict":
if in.IsNull() {
in.Skip()
out.RetryOnConflict = nil
@@ -54,11 +56,11 @@ func easyjson9de0fcbfDecodeGithubComOlivereElastic(in *jlexer.Lexer, out *bulkIn
}
*out.RetryOnConflict = int(in.Int())
}
- case "routing":
+ case "_routing":
out.Routing = string(in.String())
- case "version":
+ case "_version":
out.Version = int64(in.Int64())
- case "version_type":
+ case "_version_type":
out.VersionType = string(in.String())
case "pipeline":
out.Pipeline = string(in.String())
@@ -72,10 +74,20 @@ func easyjson9de0fcbfDecodeGithubComOlivereElastic(in *jlexer.Lexer, out *bulkIn
in.Consumed()
}
}
-func easyjson9de0fcbfEncodeGithubComOlivereElastic(out *jwriter.Writer, in bulkIndexRequestCommandOp) {
+func easyjson9de0fcbfEncodeGopkgInOlivereElasticV5(out *jwriter.Writer, in bulkIndexRequestCommandOp) {
out.RawByte('{')
first := true
_ = first
+ if in.Id != "" {
+ const prefix string = ",\"_id\":"
+ if first {
+ first = false
+ out.RawString(prefix[1:])
+ } else {
+ out.RawString(prefix)
+ }
+ out.String(string(in.Id))
+ }
if in.Index != "" {
const prefix string = ",\"_index\":"
if first {
@@ -86,15 +98,15 @@ func easyjson9de0fcbfEncodeGithubComOlivereElastic(out *jwriter.Writer, in bulkI
}
out.String(string(in.Index))
}
- if in.Id != "" {
- const prefix string = ",\"_id\":"
+ if in.TTL != "" {
+ const prefix string = ",\"_ttl\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
- out.String(string(in.Id))
+ out.String(string(in.TTL))
}
if in.Type != "" {
const prefix string = ",\"_type\":"
@@ -107,7 +119,7 @@ func easyjson9de0fcbfEncodeGithubComOlivereElastic(out *jwriter.Writer, in bulkI
out.String(string(in.Type))
}
if in.Parent != "" {
- const prefix string = ",\"parent\":"
+ const prefix string = ",\"_parent\":"
if first {
first = false
out.RawString(prefix[1:])
@@ -117,7 +129,7 @@ func easyjson9de0fcbfEncodeGithubComOlivereElastic(out *jwriter.Writer, in bulkI
out.String(string(in.Parent))
}
if in.RetryOnConflict != nil {
- const prefix string = ",\"retry_on_conflict\":"
+ const prefix string = ",\"_retry_on_conflict\":"
if first {
first = false
out.RawString(prefix[1:])
@@ -127,7 +139,7 @@ func easyjson9de0fcbfEncodeGithubComOlivereElastic(out *jwriter.Writer, in bulkI
out.Int(int(*in.RetryOnConflict))
}
if in.Routing != "" {
- const prefix string = ",\"routing\":"
+ const prefix string = ",\"_routing\":"
if first {
first = false
out.RawString(prefix[1:])
@@ -137,7 +149,7 @@ func easyjson9de0fcbfEncodeGithubComOlivereElastic(out *jwriter.Writer, in bulkI
out.String(string(in.Routing))
}
if in.Version != 0 {
- const prefix string = ",\"version\":"
+ const prefix string = ",\"_version\":"
if first {
first = false
out.RawString(prefix[1:])
@@ -147,7 +159,7 @@ func easyjson9de0fcbfEncodeGithubComOlivereElastic(out *jwriter.Writer, in bulkI
out.Int64(int64(in.Version))
}
if in.VersionType != "" {
- const prefix string = ",\"version_type\":"
+ const prefix string = ",\"_version_type\":"
if first {
first = false
out.RawString(prefix[1:])
@@ -172,27 +184,27 @@ func easyjson9de0fcbfEncodeGithubComOlivereElastic(out *jwriter.Writer, in bulkI
// MarshalJSON supports json.Marshaler interface
func (v bulkIndexRequestCommandOp) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
- easyjson9de0fcbfEncodeGithubComOlivereElastic(&w, v)
+ easyjson9de0fcbfEncodeGopkgInOlivereElasticV5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v bulkIndexRequestCommandOp) MarshalEasyJSON(w *jwriter.Writer) {
- easyjson9de0fcbfEncodeGithubComOlivereElastic(w, v)
+ easyjson9de0fcbfEncodeGopkgInOlivereElasticV5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *bulkIndexRequestCommandOp) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
- easyjson9de0fcbfDecodeGithubComOlivereElastic(&r, v)
+ easyjson9de0fcbfDecodeGopkgInOlivereElasticV5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *bulkIndexRequestCommandOp) UnmarshalEasyJSON(l *jlexer.Lexer) {
- easyjson9de0fcbfDecodeGithubComOlivereElastic(l, v)
+ easyjson9de0fcbfDecodeGopkgInOlivereElasticV5(l, v)
}
-func easyjson9de0fcbfDecodeGithubComOlivereElastic1(in *jlexer.Lexer, out *bulkIndexRequestCommand) {
+func easyjson9de0fcbfDecodeGopkgInOlivereElasticV51(in *jlexer.Lexer, out *bulkIndexRequestCommand) {
isTopLevel := in.IsStart()
if in.IsNull() {
in.Skip()
@@ -217,7 +229,7 @@ func easyjson9de0fcbfDecodeGithubComOlivereElastic1(in *jlexer.Lexer, out *bulkI
in.Consumed()
}
}
-func easyjson9de0fcbfEncodeGithubComOlivereElastic1(out *jwriter.Writer, in bulkIndexRequestCommand) {
+func easyjson9de0fcbfEncodeGopkgInOlivereElasticV51(out *jwriter.Writer, in bulkIndexRequestCommand) {
if in == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
out.RawString(`null`)
} else {
@@ -240,23 +252,23 @@ func easyjson9de0fcbfEncodeGithubComOlivereElastic1(out *jwriter.Writer, in bulk
// MarshalJSON supports json.Marshaler interface
func (v bulkIndexRequestCommand) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
- easyjson9de0fcbfEncodeGithubComOlivereElastic1(&w, v)
+ easyjson9de0fcbfEncodeGopkgInOlivereElasticV51(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v bulkIndexRequestCommand) MarshalEasyJSON(w *jwriter.Writer) {
- easyjson9de0fcbfEncodeGithubComOlivereElastic1(w, v)
+ easyjson9de0fcbfEncodeGopkgInOlivereElasticV51(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *bulkIndexRequestCommand) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
- easyjson9de0fcbfDecodeGithubComOlivereElastic1(&r, v)
+ easyjson9de0fcbfDecodeGopkgInOlivereElasticV51(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *bulkIndexRequestCommand) UnmarshalEasyJSON(l *jlexer.Lexer) {
- easyjson9de0fcbfDecodeGithubComOlivereElastic1(l, v)
+ easyjson9de0fcbfDecodeGopkgInOlivereElasticV51(l, v)
}