command
module
Version:
v0.0.0-...-6591273
Opens a new window with list of versions in this module.
Published: Feb 23, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
console BFF
Console Backend For Frontend
Specify the API
- write / update the API spec in openapi v3 format consolebff_openapi.yaml
- first time:
- write makefile
go mod init gitlab.com/realtime-asset-monitor/consolebff
generate api boiler plate code
- First time:
- Manual:
- generate models
oapi-codegen -config models.cfg.yaml ../consolebff_openapi.yaml
- generate server side for echo framework
oapi-codegen -config server.cfg.yaml ../consolebff_openapi.yaml
- Automated:
- First time
make gogenerate
makefile with a gogenerate target
Implement the api logic code
- For API operationId
v1ListAssetNames
Serve the api with Echo
Test locally the API
Shell-1
Check environment variable BFF_PROJECT_ID
to point to dev of qa project depending on test context
export BFF_PROJECT_ID="projectId"
go run main.go
Shell-2
curl 'localhost:8080/consolebff/v1/assetnames/now/days/-1'
curl 'localhost:8080/consolebff/v1/timelines/now/days/-1/asset?assetName=//bigquery.googleapis.com/projects/brunore-rces-autofix-chg-001/datasets/auto_test_us_central1_2022_11_23T11_50_03_183841451plus01_00'
Build locally the docker image
make packbuild
Test locally the docker image
Shell-1
make dockerrun
Shell-2
curl localhost:8081/consolebff/v1/assetnames
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Package consolebff provides primitives to interact with the openapi HTTP API.
|
Package consolebff provides primitives to interact with the openapi HTTP API. |
models
Package models provides primitives to interact with the openapi HTTP API.
|
Package models provides primitives to interact with the openapi HTTP API. |
Click to show internal directories.
Click to hide internal directories.