Skip to content

Commit 36a27dd

Browse files
committed
cleanup: updates module name
1 parent 8c829ba commit 36a27dd

40 files changed

+124
-123
lines changed

Diff for: aggregations_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import (
44
"testing"

Diff for: aggs_bucket.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
package esquery
1+
package os_query
22

33
//----------------------------------------------------------------------------//
44

55
// TermsAggregation represents an aggregation of type "terms", as described in
66
// https://www.elastic.co/guide/en/elasticsearch/reference/current/
7-
// search-aggregations-bucket-terms-aggregation.html
7+
//
8+
// search-aggregations-bucket-terms-aggregation.html
89
type TermsAggregation struct {
910
name string
1011
field string

Diff for: aggs_filter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
type FilterAggregation struct {
44
name string

Diff for: aggs_filter_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import "testing"
44

Diff for: aggs_metric.go

+23-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import "github.com/fatih/structs"
44

@@ -45,7 +45,8 @@ func (agg *BaseAgg) Map() map[string]interface{} {
4545

4646
// AvgAgg represents an aggregation of type "avg", as described in
4747
// https://www.elastic.co/guide/en/elasticsearch/reference/
48-
// current/search-aggregations-metrics-avg-aggregation.html
48+
//
49+
// current/search-aggregations-metrics-avg-aggregation.html
4950
type AvgAgg struct {
5051
*BaseAgg `structs:",flatten"`
5152
}
@@ -69,7 +70,8 @@ func (agg *AvgAgg) Missing(val interface{}) *AvgAgg {
6970

7071
// WeightedAvgAgg represents an aggregation of type "weighted_avg", as described
7172
// in https://www.elastic.co/guide/en/elasticsearch/reference/
72-
// current/search-aggregations-metrics-weight-avg-aggregation.html
73+
//
74+
// current/search-aggregations-metrics-weight-avg-aggregation.html
7375
type WeightedAvgAgg struct {
7476
name string
7577
apiName string
@@ -129,7 +131,8 @@ func (agg *WeightedAvgAgg) Map() map[string]interface{} {
129131

130132
// CardinalityAgg represents an aggregation of type "cardinality", as described
131133
// in https://www.elastic.co/guide/en/elasticsearch/reference/
132-
// current/search-aggregations-metrics-cardinality-aggregation.html
134+
//
135+
// current/search-aggregations-metrics-cardinality-aggregation.html
133136
type CardinalityAgg struct {
134137
*BaseAgg `structs:",flatten"`
135138

@@ -170,7 +173,8 @@ func (agg *CardinalityAgg) Map() map[string]interface{} {
170173

171174
// MaxAgg represents an aggregation of type "max", as described in:
172175
// https://www.elastic.co/guide/en/elasticsearch/reference/
173-
// current/search-aggregations-metrics-max-aggregation.html
176+
//
177+
// current/search-aggregations-metrics-max-aggregation.html
174178
type MaxAgg struct {
175179
*BaseAgg `structs:",flatten"`
176180
}
@@ -194,7 +198,8 @@ func (agg *MaxAgg) Missing(val interface{}) *MaxAgg {
194198

195199
// MinAgg represents an aggregation of type "min", as described in:
196200
// https://www.elastic.co/guide/en/elasticsearch/reference/
197-
// current/search-aggregations-metrics-min-aggregation.html
201+
//
202+
// current/search-aggregations-metrics-min-aggregation.html
198203
type MinAgg struct {
199204
*BaseAgg `structs:",flatten"`
200205
}
@@ -218,7 +223,8 @@ func (agg *MinAgg) Missing(val interface{}) *MinAgg {
218223

219224
// SumAgg represents an aggregation of type "sum", as described in:
220225
// https://www.elastic.co/guide/en/elasticsearch/reference/
221-
// current/search-aggregations-metrics-sum-aggregation.html
226+
//
227+
// current/search-aggregations-metrics-sum-aggregation.html
222228
type SumAgg struct {
223229
*BaseAgg `structs:",flatten"`
224230
}
@@ -242,7 +248,8 @@ func (agg *SumAgg) Missing(val interface{}) *SumAgg {
242248

243249
// ValueCountAgg represents an aggregation of type "value_count", as described
244250
// in https://www.elastic.co/guide/en/elasticsearch/reference/
245-
// current/search-aggregations-metrics-valuecount-aggregation.html
251+
//
252+
// current/search-aggregations-metrics-valuecount-aggregation.html
246253
type ValueCountAgg struct {
247254
*BaseAgg `structs:",flatten"`
248255
}
@@ -259,7 +266,8 @@ func ValueCount(name, field string) *ValueCountAgg {
259266

260267
// PercentilesAgg represents an aggregation of type "percentiles", as described
261268
// in https://www.elastic.co/guide/en/elasticsearch/reference/
262-
// current/search-aggregations-metrics-percentile-aggregation.html
269+
//
270+
// current/search-aggregations-metrics-percentile-aggregation.html
263271
type PercentilesAgg struct {
264272
*BaseAgg `structs:",flatten"`
265273

@@ -335,7 +343,8 @@ func (agg *PercentilesAgg) Map() map[string]interface{} {
335343

336344
// StatsAgg represents an aggregation of type "stats", as described in:
337345
// https://www.elastic.co/guide/en/elasticsearch/reference/
338-
// current/search-aggregations-metrics-stats-aggregation.html
346+
//
347+
// current/search-aggregations-metrics-stats-aggregation.html
339348
type StatsAgg struct {
340349
*BaseAgg `structs:",flatten"`
341350
}
@@ -358,7 +367,8 @@ func (agg *StatsAgg) Missing(val interface{}) *StatsAgg {
358367

359368
// StringStatsAgg represents an aggregation of type "string_stats", as described
360369
// in https://www.elastic.co/guide/en/elasticsearch/reference/
361-
// current/search-aggregations-metrics-string-stats-aggregation.html
370+
//
371+
// current/search-aggregations-metrics-string-stats-aggregation.html
362372
type StringStatsAgg struct {
363373
*BaseAgg `structs:",flatten"`
364374

@@ -400,7 +410,8 @@ func (agg *StringStatsAgg) Map() map[string]interface{} {
400410

401411
// TopHitsAgg represents an aggregation of type "top_hits", as described
402412
// in https://www.elastic.co/guide/en/elasticsearch/reference/
403-
// current/search-aggregations-metrics-top-hits-aggregation.html
413+
//
414+
// current/search-aggregations-metrics-top-hits-aggregation.html
404415
type TopHitsAgg struct {
405416
name string
406417
from uint64

Diff for: aggs_metric_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import "testing"
44

Diff for: aggs_nested.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
type NestedAggregation struct {
44
name string

Diff for: aggs_nested_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import "testing"
44

Diff for: common.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
// Source represents the "_source" option which is commonly accepted in ES
44
// queries. Currently, only the "includes" option is supported.

Diff for: count.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import (
44
"bytes"

Diff for: count_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import "testing"
44

Diff for: custom.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import (
44
"github.com/elastic/go-elasticsearch/v7"

Diff for: custom_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import "testing"
44

Diff for: delete.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import (
44
"bytes"

Diff for: es.go

+61-68
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
// Using `esquery` can make your code much easier to write, read and maintain,
1212
// and significantly reduce the amount of code you write.
1313
//
14-
//
15-
//
16-
// Usage
17-
//
18-
//
14+
// # Usage
1915
//
2016
// esquery provides a method chaining-style API for building and executing
2117
// queries and aggregations. It does not wrap the official Go client nor does it
@@ -26,78 +22,75 @@
2622
//
2723
// Getting started is extremely simple:
2824
//
29-
// package main
30-
//
31-
// import (
32-
// "context"
33-
// "log"
34-
//
35-
// "github.com/aquasecurity/esquery"
36-
// "github.com/elastic/go-elasticsearch/v7"
37-
// )
38-
//
39-
// func main() {
40-
// // connect to an ElasticSearch instance
41-
// es, err := elasticsearch.NewDefaultClient()
42-
// if err != nil {
43-
// log.Fatalf("Failed creating client: %s", err)
44-
// }
45-
//
46-
// // run a boolean search query
47-
// qRes, err := esquery.Query(
48-
// esquery.
49-
// Bool().
50-
// Must(esquery.Term("title", "Go and Stuff")).
51-
// Filter(esquery.Term("tag", "tech")),
52-
// ).Run(
53-
// es,
54-
// es.Search.WithContext(context.TODO()),
55-
// es.Search.WithIndex("test"),
56-
// )
57-
// if err != nil {
58-
// log.Fatalf("Failed searching for stuff: %s", err)
59-
// }
60-
//
61-
// defer qRes.Body.Close()
62-
//
63-
// // run an aggregation
64-
// aRes, err := esquery.Aggregate(
65-
// esquery.Avg("average_score", "score"),
66-
// esquery.Max("max_score", "score"),
67-
// ).Run(
68-
// es,
69-
// es.Search.WithContext(context.TODO()),
70-
// es.Search.WithIndex("test"),
71-
// )
72-
// if err != nil {
73-
// log.Fatalf("Failed searching for stuff: %s", err)
74-
// }
75-
//
76-
// defer aRes.Body.Close()
77-
//
78-
// // ...
79-
// }
80-
//
81-
//
82-
//
83-
// Notes
84-
//
85-
//
86-
//
87-
//* esquery currently supports version 7 of the ElasticSearch Go client.
88-
//* The library cannot currently generate "short queries". For example,
89-
// whereas ElasticSearch can accept this:
25+
// package main
26+
//
27+
// import (
28+
// "context"
29+
// "log"
30+
//
31+
// "github.com/aquasecurity/esquery"
32+
// "github.com/elastic/go-elasticsearch/v7"
33+
// )
34+
//
35+
// func main() {
36+
// // connect to an ElasticSearch instance
37+
// es, err := elasticsearch.NewDefaultClient()
38+
// if err != nil {
39+
// log.Fatalf("Failed creating client: %s", err)
40+
// }
41+
//
42+
// // run a boolean search query
43+
// qRes, err := esquery.Query(
44+
// esquery.
45+
// Bool().
46+
// Must(esquery.Term("title", "Go and Stuff")).
47+
// Filter(esquery.Term("tag", "tech")),
48+
// ).Run(
49+
// es,
50+
// es.Search.WithContext(context.TODO()),
51+
// es.Search.WithIndex("test"),
52+
// )
53+
// if err != nil {
54+
// log.Fatalf("Failed searching for stuff: %s", err)
55+
// }
56+
//
57+
// defer qRes.Body.Close()
58+
//
59+
// // run an aggregation
60+
// aRes, err := esquery.Aggregate(
61+
// esquery.Avg("average_score", "score"),
62+
// esquery.Max("max_score", "score"),
63+
// ).Run(
64+
// es,
65+
// es.Search.WithContext(context.TODO()),
66+
// es.Search.WithIndex("test"),
67+
// )
68+
// if err != nil {
69+
// log.Fatalf("Failed searching for stuff: %s", err)
70+
// }
71+
//
72+
// defer aRes.Body.Close()
73+
//
74+
// // ...
75+
// }
76+
//
77+
// # Notes
78+
//
79+
// - esquery currently supports version 7 of the ElasticSearch Go client.
80+
//
81+
// - The library cannot currently generate "short queries". For example,
82+
// whereas ElasticSearch can accept this:
9083
//
9184
// { "query": { "term": { "user": "Kimchy" } } }
9285
//
9386
// The library will always generate this:
9487
//
95-
// { "query": { "term": { "user": { "value": "Kimchy" } } } }
88+
// { "query": { "term": { "user": { "value": "Kimchy" } } } }
9689
//
9790
// This is also true for queries such as "bool", where fields like "must" can
9891
// either receive one query object, or an array of query objects. `esquery` will
9992
// generate an array even if there's only one query object.
100-
package esquery
93+
package os_query
10194

10295
// Mappable is the interface implemented by the various query and aggregation
10396
// types provided by the package. It allows the library to easily transform the

Diff for: es_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import (
44
"encoding/json"

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/aquasecurity/esquery
1+
module github.com/deliveroo/os_query
22

33
go 1.21
44

Diff for: highlight.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import (
44
"github.com/fatih/structs"

Diff for: highlight_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import (
44
"testing"

Diff for: queries_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import (
44
"testing"

Diff for: query_boolean.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import "github.com/fatih/structs"
44

Diff for: query_boolean_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package esquery
1+
package os_query
22

33
import (
44
"testing"

0 commit comments

Comments
 (0)