Skip to content

Commit

Permalink
change package to demisto
Browse files Browse the repository at this point in the history
  • Loading branch information
bars92 committed Apr 13, 2021
1 parent 87beb1b commit 7d43bd1
Show file tree
Hide file tree
Showing 69 changed files with 154 additions and 154 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

executors:
golang:
working_directory: /tmp/github.com/elastic/go-elasticsearch
working_directory: /tmp/github.com/demisto/go-elasticsearch
docker:
- image: circleci/golang:1.11

Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
name: Build the Package
command: |
go mod verify
go build -v github.com/elastic/go-elasticsearch/...
go build -v github.com/demisto/go-elasticsearch/...
# -----------------------------------------------------------------------------------------------
# ----- LINT ------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/jobs/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<commitId>, etc.)
properties:
- github:
url: https://github.com/elastic/go-elasticsearch/
url: https://github.com/demisto/go-elasticsearch/
- inject:
properties-content: HOME=$JENKINS_HOME
concurrent: true
Expand Down
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ matrix:
docker.elastic.co/elasticsearch/elasticsearch-oss:8.0.0-SNAPSHOT
- docker run --network elasticsearch --rm appropriate/curl --max-time 120 --retry 120 --retry-delay 1 --retry-connrefused --show-error --silent http://es-integration-client:9200
script:
- gotestsum --format=short-verbose --junitfile=/tmp/integration-report.xml -- -race -cover -coverprofile=/tmp/integration-client.cov -tags='integration' -timeout=1h github.com/elastic/go-elasticsearch
- gotestsum --format=short-verbose --junitfile=/tmp/integration-report.xml -- -race -cover -coverprofile=/tmp/integration-client.cov -tags='integration' -timeout=1h github.com/demisto/go-elasticsearch
after_script:
- test -f /tmp/integration-client.cov && bash <(curl -s https://codecov.io/bash) -f /tmp/integration-client.cov

Expand Down Expand Up @@ -149,14 +149,14 @@ matrix:
- echo -en 'travis_fold:end:script.dl_es_src'
# ------ Generate API registry ------------------------------------------------------------
- echo -e "\e[33;1mGenerate API registry\e[0m" && echo -en 'travis_fold:start:script.gen_api_reg\\r\n'
- cd ${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/internal/cmd/generate && ELASTICSEARCH_BUILD_HASH=$(cat ../../../.elasticsearch_build_hash) PACKAGE_PATH=${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/esapi go generate -v ./...
- cd ${TRAVIS_HOME}/gopath/src/github.com/demisto/go-elasticsearch/internal/cmd/generate && ELASTICSEARCH_BUILD_HASH=$(cat ../../../.elasticsearch_build_hash) PACKAGE_PATH=${TRAVIS_HOME}/gopath/src/github.com/demisto/go-elasticsearch/esapi go generate -v ./...
- echo -en 'travis_fold:end:script.gen_api_reg'
# ------ Generate Go test files -----------------------------------------------------------
- echo -e "\e[33;1mGenerate Go test files\e[0m" && echo -en 'travis_fold:start:script.gen_test_files\\r'
- cd ${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/internal/cmd/generate && ELASTICSEARCH_BUILD_HASH=$(cat ../../../.elasticsearch_build_hash) go run main.go apitests --input '/tmp/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.yml' --output=../../../esapi/test
- cd ${TRAVIS_HOME}/gopath/src/github.com/demisto/go-elasticsearch/internal/cmd/generate && ELASTICSEARCH_BUILD_HASH=$(cat ../../../.elasticsearch_build_hash) go run main.go apitests --input '/tmp/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.yml' --output=../../../esapi/test
- echo -en 'travis_fold:end:script.gen_test_files'
# ------ Run tests -----------------------------------------------------------------------
- cd ${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/esapi/test && time gotestsum --format=short-verbose --junitfile=/tmp/integration-api-report.xml -- -coverpkg=github.com/elastic/go-elasticsearch/esapi -coverprofile=/tmp/integration-api.cov -tags='integration' -timeout=1h ./...
- cd ${TRAVIS_HOME}/gopath/src/github.com/demisto/go-elasticsearch/esapi/test && time gotestsum --format=short-verbose --junitfile=/tmp/integration-api-report.xml -- -coverpkg=github.com/demisto/go-elasticsearch/esapi -coverprofile=/tmp/integration-api.cov -tags='integration' -timeout=1h ./...
after_script:
- test -f /tmp/integration-api.cov && bash <(curl -s https://codecov.io/bash) -f /tmp/integration-api.cov

Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test-api: ## Run generated API integration tests
ifdef race
$(eval testapiargs += "-race")
endif
$(eval testapiargs += "-cover" "-coverpkg=github.com/elastic/go-elasticsearch/v8/esapi" "-coverprofile=$(PWD)/tmp/integration-api.cov" "-tags='integration'" "-timeout=1h")
$(eval testapiargs += "-cover" "-coverpkg=github.com/demisto/go-elasticsearch/v8/esapi" "-coverprofile=$(PWD)/tmp/integration-api.cov" "-tags='integration'" "-timeout=1h")
ifdef flavor
else
$(eval flavor='core')
Expand Down Expand Up @@ -124,8 +124,8 @@ test-coverage: ## Generate test coverage report
##@ Development
lint: ## Run lint on the package
@echo "\033[2m→ Running lint...\033[0m"
go vet github.com/elastic/go-elasticsearch/...
go list github.com/elastic/go-elasticsearch/... | 'grep' -v internal | xargs golint -set_exit_status
go vet github.com/demisto/go-elasticsearch/...
go list github.com/demisto/go-elasticsearch/... | 'grep' -v internal | xargs golint -set_exit_status

apidiff: ## Display API incompabilities
@if ! command -v apidiff > /dev/null; then \
Expand Down Expand Up @@ -225,11 +225,11 @@ endif

godoc: ## Display documentation for the package
@echo "\033[2m→ Generating documentation...\033[0m"
@echo "open http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/\n"
@echo "open http://localhost:6060/pkg/github.com/demisto/go-elasticsearch/\n"
mkdir -p /tmp/tmpgoroot/doc
rm -rf /tmp/tmpgopath/src/github.com/elastic/go-elasticsearch
mkdir -p /tmp/tmpgopath/src/github.com/elastic/go-elasticsearch
tar -c --exclude='.git' --exclude='tmp' . | tar -x -C /tmp/tmpgopath/src/github.com/elastic/go-elasticsearch
rm -rf /tmp/tmpgopath/src/github.com/demisto/go-elasticsearch
mkdir -p /tmp/tmpgopath/src/github.com/demisto/go-elasticsearch
tar -c --exclude='.git' --exclude='tmp' . | tar -x -C /tmp/tmpgopath/src/github.com/demisto/go-elasticsearch
GOROOT=/tmp/tmpgoroot/ GOPATH=/tmp/tmpgopath/ godoc -http=localhost:6060 -play

cluster: ## Launch an Elasticsearch cluster with Docker
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

The official Go client for [Elasticsearch](https://www.elastic.co/products/elasticsearch).

[![GoDoc](https://godoc.org/github.com/elastic/go-elasticsearch?status.svg)](http://godoc.org/github.com/elastic/go-elasticsearch)
[![GoDoc](https://godoc.org/github.com/demisto/go-elasticsearch?status.svg)](http://godoc.org/github.com/demisto/go-elasticsearch)
[![Travis-CI](https://travis-ci.org/elastic/go-elasticsearch.svg?branch=master)](https://travis-ci.org/elastic/go-elasticsearch)
[![Go Report Card](https://goreportcard.com/badge/github.com/elastic/go-elasticsearch)](https://goreportcard.com/report/github.com/elastic/go-elasticsearch)
[![Go Report Card](https://goreportcard.com/badge/github.com/demisto/go-elasticsearch)](https://goreportcard.com/report/github.com/demisto/go-elasticsearch)
[![codecov.io](https://codecov.io/github/elastic/go-elasticsearch/coverage.svg?branch=master)](https://codecov.io/gh/elastic/go-elasticsearch?branch=master)

## Compatibility

The client major versions correspond to the compatible Elasticsearch major versions: to connect to Elasticsearch `7.x`, use a [`7.x`](https://github.com/elastic/go-elasticsearch/tree/7.x) version of the client, to connect to Elasticsearch `6.x`, use a [`6.x`](https://github.com/elastic/go-elasticsearch/tree/6.x) version of the client.
The client major versions correspond to the compatible Elasticsearch major versions: to connect to Elasticsearch `7.x`, use a [`7.x`](https://github.com/demisto/go-elasticsearch/tree/7.x) version of the client, to connect to Elasticsearch `6.x`, use a [`6.x`](https://github.com/demisto/go-elasticsearch/tree/6.x) version of the client.

When using Go modules, include the version in the import path, and specify either an explicit version or a branch:

require github.com/elastic/go-elasticsearch/v7 7.x
require github.com/elastic/go-elasticsearch/v7 7.0.0
require github.com/demisto/go-elasticsearch/v7 7.x
require github.com/demisto/go-elasticsearch/v7 7.0.0

It's possible to use multiple versions of the client in a single project:

// go.mod
github.com/elastic/go-elasticsearch/v6 6.x
github.com/elastic/go-elasticsearch/v7 7.x
github.com/demisto/go-elasticsearch/v6 6.x
github.com/demisto/go-elasticsearch/v7 7.x

// main.go
import (
elasticsearch6 "github.com/elastic/go-elasticsearch/v6"
elasticsearch7 "github.com/elastic/go-elasticsearch/v7"
elasticsearch6 "github.com/demisto/go-elasticsearch/v6"
elasticsearch7 "github.com/demisto/go-elasticsearch/v7"
)
// ...
es6, _ := elasticsearch6.NewDefaultClient()
Expand All @@ -39,11 +39,11 @@ The `master` branch of the client is compatible with the current `master` branch

Add the package to your `go.mod` file:

require github.com/elastic/go-elasticsearch/v8 master
require github.com/demisto/go-elasticsearch/v8 master

Or, clone the repository:

git clone --branch master https://github.com/elastic/go-elasticsearch.git $GOPATH/src/github.com/elastic/go-elasticsearch
git clone --branch master https://github.com/demisto/go-elasticsearch.git $GOPATH/src/github.com/demisto/go-elasticsearch

A complete example:

Expand All @@ -53,7 +53,7 @@ mkdir my-elasticsearch-app && cd my-elasticsearch-app
cat > go.mod <<-END
module my-elasticsearch-app
require github.com/elastic/go-elasticsearch/v8 master
require github.com/demisto/go-elasticsearch/v8 master
END

cat > main.go <<-END
Expand All @@ -62,7 +62,7 @@ cat > main.go <<-END
import (
"log"
"github.com/elastic/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8"
)
func main() {
Expand Down Expand Up @@ -160,8 +160,8 @@ import (
"strings"
"sync"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/demisto/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8/esapi"
)

func main() {
Expand Down Expand Up @@ -320,7 +320,7 @@ func main() {
```

As you see in the example above, the `esapi` package allows to call the Elasticsearch APIs in two distinct ways: either by creating a struct, such as `IndexRequest`, and calling its `Do()` method by passing it a context and the client, or by calling the `Search()` function on the client directly, using the option functions such as `WithIndex()`. See more information and examples in the
[package documentation](https://godoc.org/github.com/elastic/go-elasticsearch/esapi).
[package documentation](https://godoc.org/github.com/demisto/go-elasticsearch/esapi).

The `estransport` package handles the transfer of data to and from Elasticsearch. At the moment, the implementation is really minimal: it only round-robins across the configured cluster endpoints. In future, more features — retrying failed requests, ignoring certain status codes, auto-discovering nodes in the cluster, and so on — will be added.

Expand Down
4 changes: 2 additions & 2 deletions _examples/bulk/bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"strings"
"time"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/demisto/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8/esapi"
)

type Article struct {
Expand Down
2 changes: 1 addition & 1 deletion _examples/cloudfunction/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"log"
"net/http"

"github.com/elastic/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8"
)

// ES holds a reference to the Elasticsearch client
Expand Down
4 changes: 2 additions & 2 deletions _examples/cloudfunction/function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"strings"
"testing"

"github.com/elastic/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8"

"github.com/elastic/go-elasticsearch/v8/_examples/clusterstatus"
"github.com/demisto/go-elasticsearch/v8/_examples/clusterstatus"
)

// Mock transport replaces the HTTP transport for tests
Expand Down
6 changes: 3 additions & 3 deletions _examples/cloudfunction/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/elastic/go-elasticsearch/v8/_examples/clusterstatus
module github.com/demisto/go-elasticsearch/v8/_examples/clusterstatus

go 1.11

replace github.com/elastic/go-elasticsearch/v8 => ../..
replace github.com/demisto/go-elasticsearch/v8 => ../..

require github.com/elastic/go-elasticsearch/v8 master
require github.com/demisto/go-elasticsearch/v8 master
2 changes: 1 addition & 1 deletion _examples/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"net/http"
"time"

"github.com/elastic/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _examples/customization.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"sync"
"sync/atomic"

"github.com/elastic/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8"
)

// This example demonstrates how to provide a custom transport implementation to the client
Expand Down
4 changes: 2 additions & 2 deletions _examples/encoding/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/mailru/easyjson"
"github.com/tidwall/gjson"

"github.com/elastic/go-elasticsearch/v8/_examples/encoding/model"
"github.com/elastic/go-elasticsearch/v8/esutil"
"github.com/demisto/go-elasticsearch/v8/_examples/encoding/model"
"github.com/demisto/go-elasticsearch/v8/esutil"
)

func BenchmarkEncode(b *testing.B) {
Expand Down
6 changes: 3 additions & 3 deletions _examples/encoding/easyjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"strings"
"time"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/demisto/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8/esapi"
"github.com/fatih/color"
"github.com/mailru/easyjson"

"github.com/elastic/go-elasticsearch/v8/_examples/encoding/model"
"github.com/demisto/go-elasticsearch/v8/_examples/encoding/model"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion _examples/encoding/gjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"log"
"strings"

"github.com/elastic/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8"
"github.com/fatih/color"
"github.com/tidwall/gjson"
)
Expand Down
6 changes: 3 additions & 3 deletions _examples/encoding/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/elastic/go-elasticsearch/v8/_examples/encoding
module github.com/demisto/go-elasticsearch/v8/_examples/encoding

go 1.11

replace github.com/elastic/go-elasticsearch/v8 => ../..
replace github.com/demisto/go-elasticsearch/v8 => ../..

require (
github.com/elastic/go-elasticsearch/v8 master
github.com/demisto/go-elasticsearch/v8 master

github.com/fatih/color v1.7.0

Expand Down
6 changes: 3 additions & 3 deletions _examples/encoding/jsonreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package main
import (
"log"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v8/esutil"
"github.com/demisto/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8/esapi"
"github.com/demisto/go-elasticsearch/v8/esutil"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions _examples/extension/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"net/url"
"os"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v8/estransport"
"github.com/demisto/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8/esapi"
"github.com/demisto/go-elasticsearch/v8/estransport"
)

const port = "9209"
Expand Down
4 changes: 2 additions & 2 deletions _examples/fasthttp/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"strconv"
"time"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/_examples/fasthttp"
"github.com/demisto/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8/_examples/fasthttp"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions _examples/fasthttp/fasthttp_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package fasthttp_test
import (
"testing"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/_examples/fasthttp"
"github.com/demisto/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8/_examples/fasthttp"
)

func BenchmarkHTTPClient(b *testing.B) {
Expand Down
6 changes: 3 additions & 3 deletions _examples/fasthttp/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/elastic/go-elasticsearch/v8/_examples/fasthttp
module github.com/demisto/go-elasticsearch/v8/_examples/fasthttp

go 1.11

replace github.com/elastic/go-elasticsearch/v8 => ../..
replace github.com/demisto/go-elasticsearch/v8 => ../..

require (
github.com/elastic/go-elasticsearch/v8 master
github.com/demisto/go-elasticsearch/v8 master
github.com/valyala/fasthttp v1.1.0
)
2 changes: 1 addition & 1 deletion _examples/instrumentation/apmelasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/fatih/color"
"golang.org/x/crypto/ssh/terminal"

"github.com/elastic/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8"

"go.elastic.co/apm"
"go.elastic.co/apm/module/apmelasticsearch"
Expand Down
6 changes: 3 additions & 3 deletions _examples/instrumentation/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/elastic/go-elasticsearch/v8/_examples/instrumentation/opencensus
module github.com/demisto/go-elasticsearch/v8/_examples/instrumentation/opencensus

go 1.11

replace github.com/elastic/go-elasticsearch/v8 => ../..
replace github.com/demisto/go-elasticsearch/v8 => ../..

require (
github.com/elastic/go-elasticsearch/v8 v8.0.0-20191002063538-b491ce54d752
github.com/demisto/go-elasticsearch/v8 v8.0.0-20191002063538-b491ce54d752

github.com/fatih/color v1.7.0
github.com/mattn/go-colorable v0.1.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion _examples/instrumentation/opencensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/fatih/color"
"golang.org/x/crypto/ssh/terminal"

"github.com/elastic/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8"

"go.opencensus.io/plugin/ochttp"
"go.opencensus.io/stats/view"
Expand Down
2 changes: 1 addition & 1 deletion _examples/logging/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/rs/zerolog"

"github.com/elastic/go-elasticsearch/v8"
"github.com/demisto/go-elasticsearch/v8"
)

// CustomLogger implements the estransport.Logger interface.
Expand Down
Loading

0 comments on commit 7d43bd1

Please sign in to comment.