Skip to content

Commit e9a87e4

Browse files
authored
refac(API, list-workspaces): Move api to different dir (#7)
Allows importing the api as `github.com/codesphere-cloud/cs-go/api` * Move API to api dir * Add interface for client * Add test for list workspaces
1 parent b5155e6 commit e9a87e4

File tree

59 files changed

+297
-66
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+297
-66
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ go.work.sum
2525
.env
2626
.envrc
2727
cs
28+
!**/cs/
2829

2930
# openapi generator
3031
openapitools.json

.mockery.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
all: false
2+
dir: '{{.InterfaceDir}}'
3+
force-file-write: true
4+
formatter: gofmt
5+
log-level: info
6+
structname: '{{.Mock}}{{.InterfaceName}}'
7+
pkgname: '{{.SrcPackageName}}_test'
8+
recursive: false
9+
require-template-schema-exists: true
10+
template: testify
11+
template-schema: '{{.Template}}.schema.json'
12+
packages:
13+
github.com/codesphere-cloud/cs-go/cmd:
14+
interfaces:
15+
Client:

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
OPENAPI_DIR = ./pkg/api/openapi_client
2+
OPENAPI_DIR = ./api/openapi_client
33

44
all: format build
55

@@ -12,6 +12,9 @@ lint:
1212
test:
1313
go test ./...
1414

15+
generate:
16+
go generate ./...
17+
1518
build:
1619
cd cmd/cs && go build
1720
mv cmd/cs/cs .
@@ -37,4 +40,4 @@ generate-client:
3740
${OPENAPI_DIR}/test
3841

3942

40-
generate: generate-client format
43+
generate-api: generate-client format

pkg/api/client.go renamed to api/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"net/url"
66

7-
"github.com/codesphere-cloud/cs-go/pkg/api/openapi_client"
7+
"github.com/codesphere-cloud/cs-go/api/openapi_client"
88
)
99

1010
type Client struct {
File renamed without changes.

0 commit comments

Comments
 (0)