Skip to content

Commit

Permalink
fix: GA v1 Go SDK (#90)
Browse files Browse the repository at this point in the history
* Simplify middleware implementation, inspired by net/http
* Panic on resource creation or permission requests that fail - these errors are typically unrecoverable
* Allow handler parameters to accept interface{} allowing for more handler func type flexibilty
* Add sql database resource support
* Remove requirement to return Ctx from handlers (pointers are used instead for Ctx modification)
* Update product structure, moving all resources to their own packages
* Use a single grpc connection to nitric server for efficiency
* Make the handlers and workers packages internal to avoid auto-complete pollution in IDEs
* Panic if nitric.Run() fails

---------

Co-authored-by: Jye Cusch <[email protected]>
Co-authored-by: Ryan Cartwright <[email protected]>
  • Loading branch information
3 people authored Oct 3, 2024
1 parent 39332d4 commit 3c501e1
Show file tree
Hide file tree
Showing 106 changed files with 2,606 additions and 5,470 deletions.
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
run:
timeout: "5m"
skip-files:
- tools/tools.go
- doc.go

linters:
disable-all: true
Expand All @@ -23,6 +20,9 @@ linters:
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-files:
- tools/tools.go
- doc.go
exclude-rules:
- path: _test\.go
linters:
Expand Down
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,13 @@ generate:
go run github.com/golang/mock/mockgen github.com/nitrictech/nitric/core/pkg/proto/secrets/v1 SecretManagerClient > mocks/secrets.go
go run github.com/golang/mock/mockgen github.com/nitrictech/nitric/core/pkg/proto/topics/v1 TopicsClient > mocks/topics.go
go run github.com/golang/mock/mockgen -package mock_v1 google.golang.org/grpc ClientConnInterface > mocks/grpc_clientconn.go
go run github.com/golang/mock/mockgen -package mockapi github.com/nitrictech/go-sdk/api/keyvalue KeyValue,Store > mocks/mockapi/keyvalue.go
go run github.com/golang/mock/mockgen -package mockapi github.com/nitrictech/go-sdk/api/queues Queues,Queue > mocks/mockapi/queues.go
go run github.com/golang/mock/mockgen -package mockapi github.com/nitrictech/go-sdk/api/secrets Secrets,SecretRef > mocks/mockapi/secrets.go
go run github.com/golang/mock/mockgen -package mockapi github.com/nitrictech/go-sdk/api/storage Storage,Bucket > mocks/mockapi/storage.go
go run github.com/golang/mock/mockgen -package mockapi github.com/nitrictech/go-sdk/api/topics Topics,Topic > mocks/mockapi/topics.go

# Runs tests for coverage upload to codecov.io
test-ci: generate
@echo Testing Nitric Go SDK
@go run github.com/onsi/ginkgo/ginkgo -cover -outputdir=./ -coverprofile=all.coverprofile ./resources/... ./api/... ./faas/...
@go run github.com/onsi/ginkgo/ginkgo -cover -outputdir=./ -coverprofile=all.coverprofile ./...

.PHONY: test
test: generate
@echo Testing Nitric Go SDK
@go run github.com/onsi/ginkgo/ginkgo -cover ./resources/... ./api/... ./faas/...
@go run github.com/onsi/ginkgo/ginkgo -cover ./...
67 changes: 0 additions & 67 deletions api/keyvalue/keyvalue.go

This file was deleted.

98 changes: 0 additions & 98 deletions api/keyvalue/keyvalue_test.go

This file was deleted.

66 changes: 0 additions & 66 deletions api/queues/queues.go

This file was deleted.

99 changes: 0 additions & 99 deletions api/queues/queues_test.go

This file was deleted.

Loading

0 comments on commit 3c501e1

Please sign in to comment.