directory
Version:
v0.10.0
Opens a new window with list of versions in this module.
Published: Sep 15, 2022
License: Apache-2.0
Opens a new window with license information.
README
¶
server-cloud
This directory contains the control-plane backend server for cloud deployments.
Running in development
- Create a
.env file at the root of the repo containing:
RILL_CLOUD_ENV=development
RILL_CLOUD_DATABASE_DRIVER=postgres
RILL_CLOUD_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
RILL_CLOUD_PORT=8080
- In a separate terminal, run Postgres in the background:
cd server-cloud
docker-compose up
- Run the server:
go run server-cloud/cmd/main.go
Adding endpoints
We define endpoints using OpenAPI and generate Go handlers and types using oapi-codegen. To add a new endpoint:
- Describe the new endpoint in
server-cloud/api/openapi.yaml
- Make sure you have
oapi-codegen installed by running go mod tidy
- Run:
go generate ./server-cloud/api
- Copy the new handler(s) from
server-cloud/api/server.gen.go into server-cloud/server/handlers.go and implement it
Directories
¶
Package api provides primitives to interact with the openapi HTTP API.
|
Package api provides primitives to interact with the openapi HTTP API. |
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.