lingo

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 1 Imported by: 0

README

Lingo

Lingo is a web app. I don't know what it will do, but for now the goals are:

  • single binary, many commands with different functionality, like: serving grpc, http and jobs.
  • use proto as the main way to design api's.
  • use proto to generate https gateways for the grpc servers.
  • add all https services to swagger ui so they can be easily discovered and tested.

Setup

The goal with the setup is that minimal tools are needed to run the project.

prerequisites

  • install docker.
  • install openssl, version 3 (for generating certificates and keys).
    • install with brew.
  • install atlas.

local environment

  • run setup.sh. you should be able to run the setup as many times as you want.
    • Specified deps in the buf.yaml need to be covered in your buf.lock file. If you get an error, run scripts/proto-buf-mod-update.sh to generate the buf.lock file.
    • resulting generated files are in the protogen folder.
    • check changes with the buf linter: scripts/proto-lint.sh.

Run locally

  • setup should have completed.
  • run docker-compose up.
  • To view the open-api specs for various services, open localhost:8090 in the browser.
  • List the services: docker compose config | yq '.services[]|key + " | " + .image'

Develop

The goal is to have a good developer experience. That means that the developer should have to read minimal setup guides en be up and running as fast as possible.

Debug

Linting

  • to lint, run ./scripts/lint.sh.

Testing

Test that require a database can use testcontainers.

  • to run all tests, run go run test ./....

Database migrations

Migrations are managed by atlas.

  • to create a new migration, run ./scripts/new-migration.sh <app> <name of migration>.
  • after you have written your migration, run ./scripts/hash-migration.sh <app>.

Proto

Proto files are generated to go server and client code with buf. Buf also generates Openapiv2 files in yaml and json for every service.

  • build the proto files with ./scripts/proto.sh.
  • resulting go files are in proto/gen/go/**/*.go.
  • resulting Openapiv2 files are in proto/gen/openapiv2/**/*{json,yaml}
  • lint the proto files with ./scipts/proto-lint.sh.

Guidelines.

API's

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
account/bootstrapping
Package bootstrapping contains the Initializer to set up the system data.
Package bootstrapping contains the Initializer to set up the system data.
pkg
cli
clock
Package clock provides a simple clock type that can be used to get the current time.
Package clock provides a simple clock type that can be used to get the current time.
database
database is a package that contains the database interface.
database is a package that contains the database interface.
resource
Package resource provides utilities for parsing structured resource names following Google's Resource-Oriented Design principles.
Package resource provides utilities for parsing structured resource names following Google's Resource-Oriented Design principles.
proto
gen/go/private/relay/v1
Package relay is a reverse proxy.
Package relay is a reverse proxy.
gen/go/public/account/v1
Package account is a reverse proxy.
Package account is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL