Skip to content

Commit

Permalink
party
Browse files Browse the repository at this point in the history
fixes wmi and go-init
  • Loading branch information
maddyblue committed Mar 11, 2015
1 parent d028444 commit 1d8f36c
Show file tree
Hide file tree
Showing 31 changed files with 778 additions and 8 deletions.
5 changes: 3 additions & 2 deletions _third_party/github.com/StackExchange/wmi/wmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,20 +289,21 @@ func (c *Client) loadEntity(dst interface{}, src *ole.IDispatch) (errFieldMismat
}
}
case string:
iv, err := strconv.ParseInt(val, 10, 64)
switch f.Kind() {
case reflect.String:
f.SetString(val)
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
iv, err := strconv.ParseInt(val, 10, 64)
if err != nil {
return err
}
f.SetInt(iv)
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
uv, err := strconv.ParseUint(val, 10, 64)
if err != nil {
return err
}
f.SetUint(uint64(iv))
f.SetUint(uv)
case reflect.Struct:
switch f.Type() {
case timeType:
Expand Down
27 changes: 27 additions & 0 deletions _third_party/github.com/gorilla/mux/mux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,33 @@ func TestHost(t *testing.T) {
path: "",
shouldMatch: false,
},
{
title: "Path route with single pattern with pipe, match",
route: new(Route).Path("/{category:a|b/c}"),
request: newRequest("GET", "http://localhost/a"),
vars: map[string]string{"category": "a"},
host: "",
path: "/a",
shouldMatch: true,
},
{
title: "Path route with single pattern with pipe, match",
route: new(Route).Path("/{category:a|b/c}"),
request: newRequest("GET", "http://localhost/b/c"),
vars: map[string]string{"category": "b/c"},
host: "",
path: "/b/c",
shouldMatch: true,
},
{
title: "Path route with multiple patterns with pipe, match",
route: new(Route).Path("/{category:a|b/c}/{product}/{id:[0-9]+}"),
request: newRequest("GET", "http://localhost/a/product_name/1"),
vars: map[string]string{"category": "a", "product": "product_name", "id": "1"},
host: "",
path: "/a/product_name/1",
shouldMatch: true,
},
}
for _, test := range tests {
testRoute(t, test)
Expand Down
2 changes: 1 addition & 1 deletion _third_party/github.com/olivere/elastic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ on the command line.
- [x] `bool`
- [x] `exists`
- [ ] `geo_bounding_box`
- [ ] `geo_distance`
- [x] `geo_distance`
- [ ] `geo_distance_range`
- [x] `geo_polygon`
- [ ] `geoshape`
Expand Down
9 changes: 9 additions & 0 deletions _third_party/github.com/olivere/elastic/search_aggs_avg.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package elastic
type AvgAggregation struct {
field string
script string
scriptFile string
lang string
format string
params map[string]interface{}
Expand All @@ -37,6 +38,11 @@ func (a AvgAggregation) Script(script string) AvgAggregation {
return a
}

func (a AvgAggregation) ScriptFile(scriptFile string) AvgAggregation {
a.scriptFile = scriptFile
return a
}

func (a AvgAggregation) Lang(lang string) AvgAggregation {
a.lang = lang
return a
Expand Down Expand Up @@ -77,6 +83,9 @@ func (a AvgAggregation) Source() interface{} {
if a.script != "" {
opts["script"] = a.script
}
if a.scriptFile != "" {
opts["script_file"] = a.scriptFile
}
if a.lang != "" {
opts["lang"] = a.lang
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package elastic
type CardinalityAggregation struct {
field string
script string
scriptFile string
lang string
format string
params map[string]interface{}
Expand All @@ -38,6 +39,11 @@ func (a CardinalityAggregation) Script(script string) CardinalityAggregation {
return a
}

func (a CardinalityAggregation) ScriptFile(scriptFile string) CardinalityAggregation {
a.scriptFile = scriptFile
return a
}

func (a CardinalityAggregation) Lang(lang string) CardinalityAggregation {
a.lang = lang
return a
Expand Down Expand Up @@ -90,6 +96,9 @@ func (a CardinalityAggregation) Source() interface{} {
if a.script != "" {
opts["script"] = a.script
}
if a.scriptFile != "" {
opts["script_file"] = a.scriptFile
}
if a.lang != "" {
opts["lang"] = a.lang
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package elastic
type DateHistogramAggregation struct {
field string
script string
scriptFile string
lang string
params map[string]interface{}
subAggregations map[string]Aggregation
Expand Down Expand Up @@ -47,6 +48,11 @@ func (a DateHistogramAggregation) Script(script string) DateHistogramAggregation
return a
}

func (a DateHistogramAggregation) ScriptFile(scriptFile string) DateHistogramAggregation {
a.scriptFile = scriptFile
return a
}

func (a DateHistogramAggregation) Lang(lang string) DateHistogramAggregation {
a.lang = lang
return a
Expand Down Expand Up @@ -229,6 +235,9 @@ func (a DateHistogramAggregation) Source() interface{} {
if a.script != "" {
opts["script"] = a.script
}
if a.scriptFile != "" {
opts["script_file"] = a.scriptFile
}
if a.lang != "" {
opts["lang"] = a.lang
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
type DateRangeAggregation struct {
field string
script string
scriptFile string
lang string
params map[string]interface{}
subAggregations map[string]Aggregation
Expand Down Expand Up @@ -53,6 +54,11 @@ func (a DateRangeAggregation) Script(script string) DateRangeAggregation {
return a
}

func (a DateRangeAggregation) ScriptFile(scriptFile string) DateRangeAggregation {
a.scriptFile = scriptFile
return a
}

func (a DateRangeAggregation) Lang(lang string) DateRangeAggregation {
a.lang = lang
return a
Expand Down Expand Up @@ -174,6 +180,9 @@ func (a DateRangeAggregation) Source() interface{} {
if a.script != "" {
opts["script"] = a.script
}
if a.scriptFile != "" {
opts["script_file"] = a.scriptFile
}
if a.lang != "" {
opts["lang"] = a.lang
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package elastic
type ExtendedStatsAggregation struct {
field string
script string
scriptFile string
lang string
format string
params map[string]interface{}
Expand All @@ -36,6 +37,11 @@ func (a ExtendedStatsAggregation) Script(script string) ExtendedStatsAggregation
return a
}

func (a ExtendedStatsAggregation) ScriptFile(scriptFile string) ExtendedStatsAggregation {
a.scriptFile = scriptFile
return a
}

func (a ExtendedStatsAggregation) Lang(lang string) ExtendedStatsAggregation {
a.lang = lang
return a
Expand Down Expand Up @@ -76,6 +82,9 @@ func (a ExtendedStatsAggregation) Source() interface{} {
if a.script != "" {
opts["script"] = a.script
}
if a.scriptFile != "" {
opts["script_file"] = a.scriptFile
}
if a.lang != "" {
opts["lang"] = a.lang
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package elastic
type GeoBoundsAggregation struct {
field string
script string
scriptFile string
lang string
params map[string]interface{}
wrapLongitude *bool
Expand All @@ -30,6 +31,11 @@ func (a GeoBoundsAggregation) Script(script string) GeoBoundsAggregation {
return a
}

func (a GeoBoundsAggregation) ScriptFile(scriptFile string) GeoBoundsAggregation {
a.scriptFile = scriptFile
return a
}

func (a GeoBoundsAggregation) Lang(lang string) GeoBoundsAggregation {
a.lang = lang
return a
Expand Down Expand Up @@ -81,6 +87,9 @@ func (a GeoBoundsAggregation) Source() interface{} {
if a.script != "" {
opts["script"] = a.script
}
if a.scriptFile != "" {
opts["script_file"] = a.scriptFile
}
if a.lang != "" {
opts["lang"] = a.lang
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package elastic
type HistogramAggregation struct {
field string
script string
scriptFile string
lang string
params map[string]interface{}
subAggregations map[string]Aggregation
Expand Down Expand Up @@ -42,6 +43,11 @@ func (a HistogramAggregation) Script(script string) HistogramAggregation {
return a
}

func (a HistogramAggregation) ScriptFile(scriptFile string) HistogramAggregation {
a.scriptFile = scriptFile
return a
}

func (a HistogramAggregation) Lang(lang string) HistogramAggregation {
a.lang = lang
return a
Expand Down
9 changes: 9 additions & 0 deletions _third_party/github.com/olivere/elastic/search_aggs_max.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package elastic
type MaxAggregation struct {
field string
script string
scriptFile string
lang string
format string
params map[string]interface{}
Expand All @@ -37,6 +38,11 @@ func (a MaxAggregation) Script(script string) MaxAggregation {
return a
}

func (a MaxAggregation) ScriptFile(scriptFile string) MaxAggregation {
a.scriptFile = scriptFile
return a
}

func (a MaxAggregation) Lang(lang string) MaxAggregation {
a.lang = lang
return a
Expand Down Expand Up @@ -77,6 +83,9 @@ func (a MaxAggregation) Source() interface{} {
if a.script != "" {
opts["script"] = a.script
}
if a.scriptFile != "" {
opts["script_file"] = a.scriptFile
}
if a.lang != "" {
opts["lang"] = a.lang
}
Expand Down
9 changes: 9 additions & 0 deletions _third_party/github.com/olivere/elastic/search_aggs_min.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package elastic
type MinAggregation struct {
field string
script string
scriptFile string
lang string
format string
params map[string]interface{}
Expand All @@ -37,6 +38,11 @@ func (a MinAggregation) Script(script string) MinAggregation {
return a
}

func (a MinAggregation) ScriptFile(scriptFile string) MinAggregation {
a.scriptFile = scriptFile
return a
}

func (a MinAggregation) Lang(lang string) MinAggregation {
a.lang = lang
return a
Expand Down Expand Up @@ -77,6 +83,9 @@ func (a MinAggregation) Source() interface{} {
if a.script != "" {
opts["script"] = a.script
}
if a.scriptFile != "" {
opts["script_file"] = a.scriptFile
}
if a.lang != "" {
opts["lang"] = a.lang
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package elastic
type PercentileRanksAggregation struct {
field string
script string
scriptFile string
lang string
format string
params map[string]interface{}
Expand Down Expand Up @@ -37,6 +38,11 @@ func (a PercentileRanksAggregation) Script(script string) PercentileRanksAggrega
return a
}

func (a PercentileRanksAggregation) ScriptFile(scriptFile string) PercentileRanksAggregation {
a.scriptFile = scriptFile
return a
}

func (a PercentileRanksAggregation) Lang(lang string) PercentileRanksAggregation {
a.lang = lang
return a
Expand Down Expand Up @@ -100,6 +106,9 @@ func (a PercentileRanksAggregation) Source() interface{} {
if a.script != "" {
opts["script"] = a.script
}
if a.scriptFile != "" {
opts["script_file"] = a.scriptFile
}
if a.lang != "" {
opts["lang"] = a.lang
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package elastic
type PercentilesAggregation struct {
field string
script string
scriptFile string
lang string
format string
params map[string]interface{}
Expand Down Expand Up @@ -37,6 +38,11 @@ func (a PercentilesAggregation) Script(script string) PercentilesAggregation {
return a
}

func (a PercentilesAggregation) ScriptFile(scriptFile string) PercentilesAggregation {
a.scriptFile = scriptFile
return a
}

func (a PercentilesAggregation) Lang(lang string) PercentilesAggregation {
a.lang = lang
return a
Expand Down Expand Up @@ -99,6 +105,9 @@ func (a PercentilesAggregation) Source() interface{} {
if a.script != "" {
opts["script"] = a.script
}
if a.scriptFile != "" {
opts["script_file"] = a.scriptFile
}
if a.lang != "" {
opts["lang"] = a.lang
}
Expand Down
Loading

0 comments on commit 1d8f36c

Please sign in to comment.