Library code shared among our repositories
For an overview of the project, see the DIMO technical documentation site.
Use the VIN type for strings that are VIN's and it gets some basic decoding functionality (eg. year, or tesla model).
Convention over configuration library for typed configurations that can read from yaml file or env vars. Provides an opinionated way of dealing with configurations: for local development we want to use yaml config files, and on higher level environments we want settings to come from environment variables (we use kubernetes). Supported types are: string, int, int64, bool.
- modify the config_loader_test.go by updating the tests (
Test_loadFromEnvVars
andTest_loadFromYaml
) for your scenario with the desired type in the example settings struct - modify config_loader func
matchEnvVarToField
by adding a case for your type. - modify
loadFromEnvVars
by adding to the specialTypes list. - modify the
yaml
library per readme there, git push, make a release - then go get with the new version eg.
go get github.com/DIMO-Network/yaml@v0.1.0
from this repo
We should probably put these in the repositories of the services that own them, but we are putting this off for now. To make changes to the current suite for, e.g., the devices API, run
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative api/devices/*.proto
brew install golangci-lint
golangci-lint run
This should use the settings from .golangci.yml
, which you can override.
If brew version does not work, download from https://github.com/golangci/golangci-lint/releases (darwin arm64 if M1), then copy to /usr/local/bin and sudo xattr -c golangci-lint