Rollback elastic search, use godep for dependencies

This commit is contained in:
Leonid Bugaev
2014-09-04 23:35:56 +04:00
parent 674d6036d1
commit c0dc1b3a53
6 changed files with 17 additions and 14 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
*.swp
Godeps
*.gor
+4 -2
View File
@@ -1,5 +1,7 @@
FROM google/golang
RUN go get github.com/tools/godep
WORKDIR /gopath/src/gor
ADD . /gopath/src/gor
RUN go get gor
ADD . /gopath/src/gor
+4 -4
View File
@@ -16,10 +16,10 @@ dbuild:
docker build -t gor .
dtest:
docker run -t -i gor go test -v
docker run -v `pwd`:/gopath/src/gor -t -i gor godep go test -v
run:
docker run -t -i gor go run $(SOURCE) --input-dummy=0 --output-dummy=0 --verbose
drun:
docker run -v `pwd`:/gopath/src/gor -t -i gor godep go run $(SOURCE) --input-dummy=0 --output-dummy=0 --verbose
dbash:
docker run -t -i gor /bin/bash
docker run -v `pwd`:/gopath/src/gor -t -i gor /bin/bash
+4 -2
View File
@@ -197,13 +197,15 @@ https://github.com/buger/gor/releases
```
## Building from source
We use `godep` for managing dependencies, you can find instructions here: https://github.com/tools/godep. Basically it means that all `go` calls should be prefixed by `godep` command.
1. Setup standard Go environment http://golang.org/doc/code.html and ensure that $GOPATH environment variable properly set.
2. `go get github.com/buger/gor`.
3. `cd $GOPATH/src/github.com/buger/gor`
4. `go build` to get binary, or `go test` to run tests
4. `godep go build` to get binary, or `go test` to run tests
## Development
Project contains Docker environment
Project contains Docker environment.
1. Build container: `make dbuild`
2. Run tests: `make dtest`
@@ -1,4 +1,4 @@
package elasticsearch
package main
import (
"encoding/json"
+3 -4
View File
@@ -2,8 +2,7 @@ package main
import (
"bufio"
"bytes"
es "github.com/buger/gor/elasticsearch"
"bytes"
"io"
"log"
"net/http"
@@ -50,7 +49,7 @@ type HTTPOutput struct {
headers HTTPHeaders
methods HTTPMethods
elasticSearch *es.ESPlugin
elasticSearch *ESPlugin
bufStats *GorStat
}
@@ -77,7 +76,7 @@ func NewHTTPOutput(options string, headers HTTPHeaders, methods HTTPMethods, url
o.bufStats = NewGorStat("output_http")
if elasticSearchAddr != "" {
o.elasticSearch = new(es.ESPlugin)
o.elasticSearch = new(ESPlugin)
o.elasticSearch.Init(elasticSearchAddr)
}