Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/blndgs/model

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/blndgs/model

  • v0.55.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

Model

codecov NPM Version Go Release

Reusing data types, domain model or Shared Kernel in DDD parlance. This uses Protobuf definitions and holds the equivalent code for both Golang and Typescript that can be used in userland code.

Protobuf

If you don’t have buf installed, follow the installation guide from buf.build.

Generating models

buf generate

Updating the model

All models are currently defined in the asset.proto file. It is a relatively small model.

If adding lots of models, might make sense to split into a new file.

The below steps are needed to successfully update and distribute the models:

  • Add model changes to .proto file.
  • Verify there are no errors by linting. Use buf lint
  • Also format the proto files using buf format -w.
  • Generate the code definition of your model. Use buf generate
  • If adding support for a new language, please update buf.gen.yaml to include the task.
  • Commit the generated code.
  • Bump up the version number in package.json

Reproducible models

On every PR and Push, Github actions runs multiple tasks, one of which runs buf generate on the CI runner and checks if there is a diff between the generated code you are submitting and what it generates. If there is a diff, the CI run fails.

This ensures bad code isn't mistakenly committed and we can safely distribute the changes to everyone

Test

For the test run the following command:

go test ./...

FAQs

Package last updated on 25 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc