consolebff

command module
v0.0.0-...-6591273 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

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:

Implement the api logic code

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

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL