Giter VIP home page Giter VIP logo

model's Introduction

Model

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 ./...

model's People

Contributors

blewater avatar adelowo avatar singhhp1069 avatar petroskalligeris avatar eliasiofir avatar

Watchers

 avatar

Forkers

adelowo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.