Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/api-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ name: api-lint

env:
API_TYPES: 'OAS'
API_DIRECTORIES: 'illmock/directory broker/oapi'
API_DIRECTORIES: 'directory broker/oapi'
API_EXCLUDES: 'directory_config.yaml cfg.yaml'
API_WARNINGS: false

on:
workflow_dispatch:
push:
paths:
- 'illmock/directory/**'
- 'directory/**'
- 'broker/oapi/**'
pull_request:
paths:
- 'illmock/directory/**'
- 'directory/**'
- 'broker/oapi/**'

jobs:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS := iso18626 ncip sru marcxml httpclient illmock broker
SUBDIRS := iso18626 ncip directory sru marcxml httpclient illmock broker
GOALS := $(or $(MAKECMDGOALS),all)

.PHONY: $(GOALS) $(SUBDIRS)
Expand Down
27 changes: 27 additions & 0 deletions directory/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
GO ?= go
GIT ?= git
GOFMT ?= gofmt "-s"
OS ?= $(shell uname)

OAPI_CFG = directory_config.yaml
OAPI_SPEC = directory_api.yaml
OAPI_GEN = directory_gen.go
COVERAGE=coverage.out

.PHONY: all generate lint check clean

all: generate

generate: $(OAPI_GEN)

$(OAPI_GEN): $(OAPI_CFG) $(OAPI_SPEC)
$(GO) run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config ./$(OAPI_CFG) ./$(OAPI_SPEC)

clean:
rm -f $(OAPI_GEN) $(COVERAGE)

check: generate
$(GO) test -v -cover -coverpkg=./... -coverprofile=$(COVERAGE) ./...

lint: generate
$(GO) run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest run
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: directory
output: directory/directory_gen.go
output: directory_gen.go
output-options:
nullable-type: true
generate:
Expand Down
11 changes: 11 additions & 0 deletions directory/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module github.com/indexdata/crosslink/directory

go 1.25

require github.com/oapi-codegen/runtime v1.1.2

require (
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/stretchr/testify v1.11.1 // indirect
)
21 changes: 21 additions & 0 deletions directory/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
github.com/oapi-codegen/runtime v1.1.2 h1:P2+CubHq8fO4Q6fV1tqDBZHCwpVpvPg7oKiYzQgXIyI=
github.com/oapi-codegen/runtime v1.1.2/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ use (
./marcxml
./ncip
./sru
./directory
)
12 changes: 1 addition & 11 deletions illmock/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,14 @@ COMMIT_ID=commit.txt
COVERAGE=coverage.out
PROGRAMS := $(shell cd cmd; ls)

# OpenAPI
OAPI_DIR=directory
OAPI_CFG = $(OAPI_DIR)/directory_config.yaml
OAPI_SPEC = $(OAPI_DIR)/directory_api.yaml
OAPI_GEN = $(OAPI_DIR)/directory_gen.go

.PHONY: all check clean coverage docker fmt fmt-check generate run doc view-coverage

all: $(PROGRAMS)

docker: generate
cd .. && $(DOCKER) build -t indexdata/$(MODULE):latest -f ./$(MODULE)/Dockerfile .

generate: $(COMMIT_ID) $(OAPI_GEN)

$(OAPI_GEN): $(OAPI_CFG) $(OAPI_SPEC)
$(GO) run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config ./$(OAPI_CFG) ./$(OAPI_SPEC)
generate: $(COMMIT_ID)

$(COMMIT_ID):
$(GIT) rev-parse --short HEAD | tr -d '\n' > $(COMMIT_ID)
Expand Down Expand Up @@ -63,5 +54,4 @@ clean:
rm -f $(PROGRAMS)
rm -f $(COVERAGE)
rm -f $(COMMIT_ID)
rm -f $(OAPI_GEN)
rm -f README.html
2 changes: 1 addition & 1 deletion illmock/app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"time"

"github.com/google/uuid"
"github.com/indexdata/crosslink/directory"
"github.com/indexdata/crosslink/httpclient"
"github.com/indexdata/crosslink/illmock/directory"
"github.com/indexdata/crosslink/illmock/flows"
"github.com/indexdata/crosslink/illmock/testutil"
"github.com/indexdata/crosslink/iso18626"
Expand Down
2 changes: 1 addition & 1 deletion illmock/dirmock/dirmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"

"github.com/indexdata/cql-go/cql"
"github.com/indexdata/crosslink/illmock/directory"
"github.com/indexdata/crosslink/directory"
)

var _ directory.StrictServerInterface = (*DirectoryMock)(nil)
Expand Down
2 changes: 1 addition & 1 deletion illmock/dirmock/dirmock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

"github.com/indexdata/cql-go/cql"
"github.com/indexdata/crosslink/illmock/directory"
"github.com/indexdata/crosslink/directory"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 2 additions & 0 deletions illmock/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/indexdata/crosslink/marcxml v0.0.0
github.com/indexdata/crosslink/sru v0.0.0
github.com/indexdata/crosslink/ncip v0.0.0
github.com/indexdata/crosslink/directory v0.0.0
)

replace (
Expand All @@ -16,6 +17,7 @@ replace (
github.com/indexdata/crosslink/marcxml => ../marcxml
github.com/indexdata/crosslink/sru => ../sru
github.com/indexdata/crosslink/ncip => ../ncip
github.com/indexdata/crosslink/directory => ../directory
)

require (
Expand Down
Loading