builder-hub

module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT

README

BuilderHub

Test status

Contains code for the builder hub service that acts as a data source for builders registration and configuration.

Docs here: https://buildernet.github.io/docs/


Getting started

# start the server
go run cmd/httpserver/main.go

# public endpoints
curl localhost:8080/api/l1-builder/v1/measurements

# client-aTLS secured endpoints
curl localhost:8080/api/l1-builder/v1/builders
curl localhost:8080/api/l1-builder/v1/configuration
curl -X POST localhost:8080/api/l1-builder/v1/register_credentials/rbuilder
Development

Install dev dependencies

go install mvdan.cc/gofumpt@v0.4.0
go install honnef.co/go/tools/cmd/staticcheck@v0.4.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
go install go.uber.org/nilaway/cmd/nilaway@v0.0.0-20240821220108-c91e71c080b7
go install github.com/daixiang0/gci@v0.11.2

Lint, test, format

make lint
make test
make fmt
Database tests
# start the database
docker run -d --name postgres-test -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgres

for file in schema/*.sql; do psql "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" -f $file; done

# run the tests
RUN_DB_TESTS=1 make test

# stop the database
docker rm -f postgres-test

Directories

Path Synopsis
adapters
database
Package database provides a database adapter for postgres
Package database provides a database adapter for postgres
secrets
Package secrets contains logic for adapter to aws secrets manager
Package secrets contains logic for adapter to aws secrets manager
Package application contains application logic for the builder-hub
Package application contains application logic for the builder-hub
cmd
Package common contains common utilities and functions used by the service.
Package common contains common utilities and functions used by the service.
Package domain contains domain area types/functions for builder hub
Package domain contains domain area types/functions for builder hub
Package httpserver implements the core HTTP server
Package httpserver implements the core HTTP server
Package metrics contains all application-logic metrics
Package metrics contains all application-logic metrics
Package ports contains entry-point related logic for builder-hub.
Package ports contains entry-point related logic for builder-hub.

Jump to

Keyboard shortcuts

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