NOTICE: WORKING IN PROGRESS, DON'T USE IT IN PRODUCTION
The purpose of this repository is to store the JSON model for the Guance Cloud Console.
JSON Model is inspired by Grafana JSON Model and implemented by Guance's technical stack.
It has the following advantages:
- It is an SSOT (Single Source of Truth) for opening data structure.
- It is easy to be version controlled.
There are some artifacts released:
Name | Source Directory | Package Hosted | Description |
---|---|---|---|
Go | /generated/go | gomod |
Go package |
Typescript | /generated/ts | npm |
Typescript package |
There are some JSON models in this repository:
Name | Source Directory | Current Version |
---|---|---|
Dashboard | dashboard | v1alpha1 |
Monitor | monitor | v1alpha1 |
We use the solution same as the Open Metrics project of CNCF. And add our code generation pipeline.
There are some features about it:
- It is based on Protocol Buffers.
- It can easily be compiled into other languages like Go, Typescript, etc.
- It can detect and suspend the breaking changes of the JSON model.
graph LR
Protobuf[Protocol Buffers] --> Linter --> Detector[Break Detector] --> Generator
Generator --> Go
Generator --> Typescript
Many organization has their contract management solution. Kubernetes API and Buf Build are excellent references.
If you want to add a new JSON model, create a new ProtoBuf file in the guance/io/json
folder, and run the make
script to manage SDLC (Software Development Life Cycle).
make gen # generate code
make fmt # format code
make lint # lint code
make test # run tests
This Contribution Guidelines document contains more detailed information about contributing to this repository.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.