Skip to content

Commit

Permalink
Merge pull request #26 from kwilteam/feature/default_configuration
Browse files Browse the repository at this point in the history
Feature/default configuration
  • Loading branch information
Yaiba authored Feb 13, 2023
2 parents dc5c95d + 9d3220b commit 69ce43d
Show file tree
Hide file tree
Showing 31 changed files with 620 additions and 353 deletions.
5 changes: 2 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ tasks:

build:gateway:
desc: Builds the API Gateway
deps:
- pb:gen:openapi
deps: [ pb:compile:all ]
cmds:
- go build -o .build/kwil-gateway ./cmd/kwil-gateway
generates:
Expand Down Expand Up @@ -70,7 +69,7 @@ tasks:
deps:
- k8s:helm:update
- docker:kwild
- docker:kwil-gateway
- docker:gateway
cmds:
- helm install kwil deployments/helm/kwil -f deployments/helm/kwil/dev-values.yaml

Expand Down
19 changes: 3 additions & 16 deletions api/Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
version: '3'

tasks:
gen:openapi:
desc: Generates the OpenAPI spec
cmds:
- |
protoc -I api/protobuf \
--go_out=. --go_opt module=kwil \
--go-grpc_out=. --go-grpc_opt module=kwil \
--grpc-gateway_out=. --grpc-gateway_opt module=kwil --grpc-gateway_opt generate_unbound_methods=true \
--openapiv2_out=. --openapiv2_opt allow_merge=true --openapiv2_opt merge_file_name=api/openapi-spec/api/v0/api \
api/protobuf/kwil/*/v0/*.proto
sources:
- api/protobuf/kwil/*/v0/*.proto
generates:
- api/protobuf/kwil/*/v0/gen/go/*
- api/openapi-spec/api/v0/*

## Compile all protobufs
compile:all:
desc: Compiles all protobufs
preconditions:
- sh: a="libprotoc 3.21.12";b=`protoc --version`;test "$a" = "$b"
msg: "Protobuf compiler version is not 3.21.12, please install the correct version"
cmds:
- |
protoc -I ./proto \
Expand Down
33 changes: 33 additions & 0 deletions api/openapi-spec/api/v0/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,28 @@
]
}
},
"/api/v0/config/gateway": {
"get": {
"operationId": "ConfigService_GetGateway",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/configGetGatewayCfgResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"tags": [
"ConfigService"
]
}
},
"/api/v0/ping": {
"get": {
"operationId": "TxService_Ping",
Expand Down Expand Up @@ -708,6 +730,9 @@
"properties": {
"funding": {
"$ref": "#/definitions/configGetFundingCfgResponse"
},
"gateway": {
"$ref": "#/definitions/configGetGatewayCfgResponse"
}
}
},
Expand All @@ -726,6 +751,14 @@
}
}
},
"configGetGatewayCfgResponse": {
"type": "object",
"properties": {
"graphql_url": {
"type": "string"
}
}
},
"pricingEstimateRequest": {
"type": "object",
"properties": {
Expand Down
222 changes: 180 additions & 42 deletions api/protobuf/config/v0/service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 69ce43d

Please sign in to comment.