hyperweb-io / hyperweb-io/telescope
research simpler protobufjs style
- Dominant language
- TypeScript
- Stars
- 154
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Akashlytics takes an interesting, very minimal approach: https://github.com/Akashlytics/akashlytics-deploy/blob/master/src/shared/protoTypes/v1beta2.js
```js
import { Field, Enum, Type, Root } from "protobufjs";
// Deployments
const DeploymentID = new Type("DeploymentID").add(new Field("owner", 1, "string")).add(new Field("dseq", 2, "uint64"));
const Coin = new Type("Coin").add(new Field("denom", 1, "string")).add(new Field("amount", 2, "string"));
const Kind = new Enum("Kind", { SHARED_HTTP: 0, RANDOM_PORT: 1 });
const Endpoint = new Type("Endpoint").add(new Field("kind", 1, "Kind")).add(Kind).add(new Field("sequence_number", 2, "uint32"));
const Attribute = new Type("Attribute").add(new Field("key", 1, "string")).add(new Field("value", 2, "string"));
const ResourceValue = new Type("ResourceValue").add(new Field("val", 1, "string"));
const CPU = new Type("CPU")
.add(new Field("units", 1, "ResourceValue"))
.add(ResourceValue)
.add(new Field("attributes", 2, "Attribute", "repeated"))
.add(Attribute);
const Memory = new Type("Memory")
.add(new Field("quantity", 1, "ResourceValue"))
.add(ResourceValue)
.add(new Field("attributes", 2, "Attribute", "repeated"))
.add(Attribute);
const Storage = new Type("Storage")
.add(new Field("name", 1, "string"))
.add(new Field("quantity", 2, "ResourceValue"))
.add(ResourceValue)
.add(new Field("attributes", 3, "Attribute", "repeated"))
.add(Attribute);
const ResourceUnits = new Type("ResourceUnits")
.add(new Field("cpu", 1, "CPU"))
.add(CPU)
.add(new Field("memory", 2, "Memory"))
.add(Memory)
.add(new Field("storage", 3, "Storage", "repeated"))
.add(Storage)
.add(new Field("endpoints", 4, "Endpoint", "repeated"))
.add(Endpoint);
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.