Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandor Torok committed Apr 23, 2018
1 parent 5f01dfb commit 18d244b
Show file tree
Hide file tree
Showing 19 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion healthcheck.go
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"net/http"

"github.com/Financial-Times/content-rw-elasticsearch/concept"
"github.com/Financial-Times/content-rw-elasticsearch/service/concept"
"github.com/Financial-Times/content-rw-elasticsearch/es"
health "github.com/Financial-Times/go-fthealth/v1_1"
"github.com/Financial-Times/go-logger"
Expand Down
10 changes: 5 additions & 5 deletions main.go
Expand Up @@ -9,14 +9,14 @@ import (
"syscall"
"time"

"github.com/Financial-Times/content-rw-elasticsearch/concept"
"github.com/Financial-Times/content-rw-elasticsearch/service/concept"
"github.com/Financial-Times/content-rw-elasticsearch/es"
"github.com/Financial-Times/content-rw-elasticsearch/messaging"
health "github.com/Financial-Times/go-fthealth/v1_1"
"github.com/Financial-Times/go-logger"
"github.com/Financial-Times/message-queue-gonsumer/consumer"
status "github.com/Financial-Times/service-status-go/httphandlers"
"github.com/jawher/mow.cli"
"github.com/Financial-Times/content-rw-elasticsearch/service"
)

const (
Expand Down Expand Up @@ -140,14 +140,14 @@ func main() {
},
}

service := es.NewService(*indexName)
svc := es.NewService(*indexName)
var wg sync.WaitGroup
concordanceApiService := concept.NewConcordanceApiService(*publicConcordancesEndpoint, httpClient)
indexer := messaging.NewIndexer(service, concordanceApiService, httpClient, queueConfig, &wg, es.NewClient)
indexer := service.NewIndexer(svc, concordanceApiService, httpClient, queueConfig, &wg, es.NewClient)

indexer.Start(*appSystemCode, *appName, *indexName, *port, accessConfig, httpClient)

healthService := newHealthService(&queueConfig, service, httpClient, concordanceApiService, *appSystemCode)
healthService := newHealthService(&queueConfig, svc, httpClient, concordanceApiService, *appSystemCode)
serveAdminEndpoints(healthService, *appSystemCode, *appName, *port)

indexer.Stop()
Expand Down
12 changes: 6 additions & 6 deletions concept/concordance.go → service/concept/concordance.go
Expand Up @@ -15,23 +15,23 @@ const (
uppAuthority = "http://api.ft.com/system/UPP"
)

type concept struct {
type Concept struct {
ID string `json:"id"`
APIURL string `json:"apiUrl,omitempty"`
}

type identifier struct {
type Identifier struct {
IdentifierValue string `json:"identifierValue"`
Authority string `json:"authority"`
}

type concordance struct {
Concept concept `json:"concept"`
Identifier identifier `json:"identifier"`
type Concordance struct {
Concept Concept `json:"concept"`
Identifier Identifier `json:"identifier"`
}

type ConcordancesResponse struct {
Concordances []concordance `json:"concordances"`
Concordances []Concordance `json:"concordances"`
}

type ConceptModel struct {
Expand Down
Expand Up @@ -80,13 +80,13 @@ func TestConcordanceApiService_GetConceptsSuccessfully(t *testing.T) {
sampleID := ThingURIPrefix + uuid.NewRandom().String()

sampleResponse := ConcordancesResponse{
Concordances: []concordance{
Concordances: []Concordance{
{
Concept: concept{
Concept: Concept{
ID: sampleID,
APIURL: sampleID,
},
Identifier: identifier{
Identifier: Identifier{
Authority: tmeAuthority,
IdentifierValue: "TME-ID",
},
Expand Down
6 changes: 3 additions & 3 deletions messaging/mapper.go → service/mapper.go
@@ -1,13 +1,13 @@
package messaging
package service

import (
"encoding/base64"
"strings"
"time"

"github.com/Financial-Times/content-rw-elasticsearch/concept"
"github.com/Financial-Times/content-rw-elasticsearch/service/concept"
"github.com/Financial-Times/content-rw-elasticsearch/content"
"github.com/Financial-Times/content-rw-elasticsearch/messaging/utils"
"github.com/Financial-Times/content-rw-elasticsearch/service/utils"
"github.com/Financial-Times/go-logger"
"github.com/Financial-Times/uuid-utils-go"
"github.com/pkg/errors"
Expand Down
4 changes: 2 additions & 2 deletions messaging/mapper_test.go → service/mapper_test.go
@@ -1,12 +1,12 @@
package messaging
package service

import (
"encoding/json"
"io/ioutil"
"testing"
"time"

"github.com/Financial-Times/content-rw-elasticsearch/concept"
"github.com/Financial-Times/content-rw-elasticsearch/service/concept"
"github.com/Financial-Times/content-rw-elasticsearch/content"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand Down
4 changes: 2 additions & 2 deletions messaging/message_handler.go → service/message_handler.go
@@ -1,4 +1,4 @@
package messaging
package service

import (
"encoding/json"
Expand All @@ -7,7 +7,7 @@ import (
"sync"
"time"

"github.com/Financial-Times/content-rw-elasticsearch/concept"
"github.com/Financial-Times/content-rw-elasticsearch/service/concept"
"github.com/Financial-Times/content-rw-elasticsearch/content"
"github.com/Financial-Times/content-rw-elasticsearch/es"
"github.com/Financial-Times/go-logger"
Expand Down
@@ -1,4 +1,4 @@
package messaging
package service

import (
"io/ioutil"
Expand All @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/Financial-Times/content-rw-elasticsearch/concept"
"github.com/Financial-Times/content-rw-elasticsearch/service/concept"
"github.com/Financial-Times/content-rw-elasticsearch/es"
logTest "github.com/Financial-Times/go-logger/test"
"github.com/Financial-Times/message-queue-gonsumer/consumer"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 18d244b

Please sign in to comment.