Skip to content

Commit 67c748d

Browse files
committed
Add interface for client
1 parent 807c77f commit 67c748d

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

.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/pkg/cs:
14+
interfaces:
15+
Client:

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ format:
99
lint:
1010
golangci-lint run
1111

12-
test:
12+
test: update-mocks
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

cmd/list-workspaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (l *ListWorkspacesCmd) RunE(_ *cobra.Command, args []string) (err error) {
7777
return nil
7878
}
7979

80-
func (l *ListWorkspacesCmd) getTeamIds(client *api.Client) (teams []int, err error) {
80+
func (l *ListWorkspacesCmd) getTeamIds(client cs.Client) (teams []int, err error) {
8181
if l.opts.TeamId != nil && *l.opts.TeamId >= 0 {
8282
teams = append(teams, *l.opts.TeamId)
8383
return

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@ go 1.24.2
55
require (
66
github.com/jedib0t/go-pretty/v6 v6.6.7
77
github.com/spf13/cobra v1.9.1
8+
github.com/stretchr/testify v1.10.0
89
gopkg.in/validator.v2 v2.0.1
910
)
1011

1112
require (
13+
github.com/davecgh/go-spew v1.1.1 // indirect
1214
github.com/inconshreveable/mousetrap v1.1.0 // indirect
1315
github.com/mattn/go-runewidth v0.0.16 // indirect
16+
github.com/pmezard/go-difflib v1.0.0 // indirect
1417
github.com/rivo/uniseg v0.4.7 // indirect
1518
github.com/spf13/pflag v1.0.6 // indirect
19+
github.com/stretchr/objx v0.5.2 // indirect
1620
golang.org/x/sys v0.30.0 // indirect
1721
golang.org/x/text v0.22.0 // indirect
22+
gopkg.in/yaml.v3 v3.0.1 // indirect
1823
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
2121
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
2222
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
2323
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
24+
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
25+
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
2426
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
2527
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
2628
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=

0 commit comments

Comments
 (0)