Skip to content

Commit

Permalink
Merge #366
Browse files Browse the repository at this point in the history
366: Rename MEILISEARCH_HOST to MEILISEARCH_URL r=alallema a=washbin

# Pull Request

## Related issue
Fixes #365 

## What does this PR do?
-  changes the name of environmental variable as suggested in the mentioned issue

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?



Co-authored-by: washbin <76929116+washbin@users.noreply.github.com>
  • Loading branch information
bors[bot] and washbin committed Oct 11, 2022
2 parents 7427b4c + 7c30c22 commit 995541c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ func TestClient_GenerateTenantToken(t *testing.T) {
args: args{
IndexUID: "TestGenerateTenantTokenWithoutApiKey",
client: NewClient(ClientConfig{
Host: getenv("MEILISEARCH_HOST", "http://localhost:7700"),
Host: getenv("MEILISEARCH_URL", "http://localhost:7700"),
APIKey: "",
}),
APIKeyUID: GetPrivateUIDKey(),
Expand Down Expand Up @@ -1198,7 +1198,7 @@ func TestClient_GenerateTenantToken(t *testing.T) {
}

client := NewClient(ClientConfig{
Host: getenv("MEILISEARCH_HOST", "http://localhost:7700"),
Host: getenv("MEILISEARCH_URL", "http://localhost:7700"),
APIKey: token,
})

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
stdin_open: true
working_dir: /home/package
environment:
- MEILISEARCH_HOST=http://meilisearch:7700
- MEILISEARCH_URL=http://meilisearch:7700
depends_on:
- meilisearch
links:
Expand Down
16 changes: 8 additions & 8 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func GetPrivateUIDKey() (key string) {

func SetUpEmptyIndex(index *IndexConfig) (resp *Index, err error) {
client := NewClient(ClientConfig{
Host: getenv("MEILISEARCH_HOST", "http://localhost:7700"),
Host: getenv("MEILISEARCH_URL", "http://localhost:7700"),
APIKey: masterKey,
})
task, err := client.CreateIndex(index)
Expand All @@ -130,7 +130,7 @@ func SetUpEmptyIndex(index *IndexConfig) (resp *Index, err error) {

func SetUpBasicIndex(indexUID string) {
client := NewClient(ClientConfig{
Host: getenv("MEILISEARCH_HOST", "http://localhost:7700"),
Host: getenv("MEILISEARCH_URL", "http://localhost:7700"),
APIKey: masterKey,
})
index := client.Index(indexUID)
Expand All @@ -156,7 +156,7 @@ func SetUpBasicIndex(indexUID string) {

func SetUpIndexWithNestedFields(indexUID string) {
client := NewClient(ClientConfig{
Host: getenv("MEILISEARCH_HOST", "http://localhost:7700"),
Host: getenv("MEILISEARCH_URL", "http://localhost:7700"),
APIKey: masterKey,
})
index := client.Index(indexUID)
Expand All @@ -183,7 +183,7 @@ func SetUpIndexWithNestedFields(indexUID string) {

func SetUpIndexForFaceting() {
client := NewClient(ClientConfig{
Host: getenv("MEILISEARCH_HOST", "http://localhost:7700"),
Host: getenv("MEILISEARCH_URL", "http://localhost:7700"),
APIKey: masterKey,
})
index := client.Index("indexUID")
Expand Down Expand Up @@ -224,7 +224,7 @@ func SetUpIndexForFaceting() {
var (
masterKey = "masterKey"
defaultClient = NewClient(ClientConfig{
Host: getenv("MEILISEARCH_HOST", "http://localhost:7700"),
Host: getenv("MEILISEARCH_URL", "http://localhost:7700"),
APIKey: masterKey,
})
defaultRankingRules = []string{
Expand All @@ -248,7 +248,7 @@ var (
)

var customClient = NewFastHTTPCustomClient(ClientConfig{
Host: getenv("MEILISEARCH_HOST", "http://localhost:7700"),
Host: getenv("MEILISEARCH_URL", "http://localhost:7700"),
APIKey: masterKey,
},
&fasthttp.Client{
Expand All @@ -257,13 +257,13 @@ var customClient = NewFastHTTPCustomClient(ClientConfig{
})

var timeoutClient = NewClient(ClientConfig{
Host: getenv("MEILISEARCH_HOST", "http://localhost:7700"),
Host: getenv("MEILISEARCH_URL", "http://localhost:7700"),
APIKey: masterKey,
Timeout: 1,
})

var privateClient = NewClient(ClientConfig{
Host: getenv("MEILISEARCH_HOST", "http://localhost:7700"),
Host: getenv("MEILISEARCH_URL", "http://localhost:7700"),
APIKey: GetPrivateKey(),
})

Expand Down

0 comments on commit 995541c

Please sign in to comment.