{"id":16327264,"url":"https://github.com/bryopsida/go-grpc-server-template","last_synced_at":"2025-04-23T10:43:01.679Z","repository":{"id":253597966,"uuid":"843969101","full_name":"bryopsida/go-grpc-server-template","owner":"bryopsida","description":"A starter template for a go grpc server ","archived":false,"fork":false,"pushed_at":"2025-04-01T17:48:20.000Z","size":91,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T18:48:36.435Z","etag":null,"topics":["badger","golang","grpc-server","starter-template","viper"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bryopsida.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-18T01:13:26.000Z","updated_at":"2025-04-01T17:47:59.000Z","dependencies_parsed_at":"2024-08-28T19:16:13.037Z","dependency_job_id":"3d615cff-69f0-4de2-b5dd-e4cc968eed00","html_url":"https://github.com/bryopsida/go-grpc-server-template","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":0.5,"last_synced_commit":"7cef411422fc0c74582fb6a6381d392bd2de3df0"},"previous_names":["bryopsida/go-grpc-server-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryopsida%2Fgo-grpc-server-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryopsida%2Fgo-grpc-server-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryopsida%2Fgo-grpc-server-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryopsida%2Fgo-grpc-server-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bryopsida","download_url":"https://codeload.github.com/bryopsida/go-grpc-server-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250419097,"owners_count":21427547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["badger","golang","grpc-server","starter-template","viper"],"created_at":"2024-10-10T23:10:53.733Z","updated_at":"2025-04-23T10:43:01.659Z","avatar_url":"https://github.com/bryopsida.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go gRPC Server Template\n\n## What is this?\n\nThis is a starter template to kick off a repo holding a gRPC server written in golang.\n\nIt includes\n\n1) A top level main that listens for SIGINT and SIGTERM and gracefully closes its database connection and the gRPC server\n2) Has a simple embedded data store [badger](https://dgraph.io/docs/badger)\n3) Has a starting point for configuration with a [interface wrapper](./config//config.go) around [viper](https://github.com/spf13/viper)\n4) Has a [github workflow](https://github.com/curium-rocks/flows/blob/main/.github/workflows/golang.yml)\n5) Has a [dev container](./.devcontainer/devcontainer.json)\n6) Has a [Dockerfile](./Dockerfile)\n7) Has a [Makefile](./Makefile) for common tasks such as building, testing, linting\n8) Is automatically updated with renovate [renovate.json](./renovate.json)\n\n## How do I change the .proto and update the associated code?\n\nYou can run `make generate-grpc-code` in the dev container and it will re-generate the golang code under api/v1 to match what's specified in the .proto file.\n\n\n## What configuration properties are available?\n\n| Configuration Property       | Default Value       | Description                           |\n|------------------------------|---------------------|---------------------------------------|\n| `database.path`              | `data/db`           | Path to the database file             |\n| `server.port`                | `50051`             | Port on which the server listens      |\n| `server.address`             | `localhost`         | Address on which the server listens   |\n| `server.tls.enabled`         | `false`             | Enable TLS for the server             |\n| `server.tls.cert`            | `\"\"`                | TLS certificate content               |\n| `server.tls.cert_path`       | `\"\"`                | Path to the TLS certificate file      |\n| `server.tls.key`             | `\"\"`                | TLS key content                       |\n| `server.tls.key_path`        | `\"\"`                | Path to the TLS key file              |\n| `server.tls.ca`              | `\"\"`                | CA certificate content                |\n| `server.tls.ca_path`         | `\"\"`                | Path to the CA certificate file       |\n\n### How to set configuration values\n\nYou can set these configuration properties using either environment variables or a YAML configuration file. Viper is used to extract the configuration properties.\n\n#### Using Environment Variables\n\nSet the environment variables with the corresponding configuration property names in uppercase and replace dots with underscores. For example:\n\n```sh\nexport DATABASE_PATH=\"custom/db/path\"\nexport SERVER_PORT=\"8080\"\nexport SERVER_ADDRESS=\"0.0.0.0\"\nexport SERVER_TLS_ENABLED=\"true\"\nexport SERVER_TLS_CERT=\"your_cert_content\"\nexport SERVER_TLS_CERT_PATH=\"/path/to/cert\"\nexport SERVER_TLS_KEY=\"your_key_content\"\nexport SERVER_TLS_KEY_PATH=\"/path/to/key\"\nexport SERVER_TLS_CA=\"your_ca_content\"\nexport SERVER_TLS_CA_PATH=\"/path/to/ca\"\n```\n\n#### Using a config file\n\nCreate a `config` file in the same directory that the process runs in.\n\nBelow is an example\n\n``` yaml\ndatabase:\n  path: \"custom/db/path\"\n\nserver:\n  port: 8080\n  address: \"0.0.0.0\"\n  tls:\n    enabled: true\n    cert: \"your_cert_content\"\n    cert_path: \"/path/to/cert\"\n    key: \"your_key_content\"\n    key_path: \"/path/to/key\"\n    ca: \"your_ca_content\"\n    ca_path: \"/path/to/ca\"\n```\n\n#### Certs/Keys\n\n`server.tls.cert` and the matching fields without the `_path` suffix, are expected to be string values in PEM format.\nThese will be used first, if they are empty, then the associated path variable is used, the expectation is the file provided in the path property is also PEM formatted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryopsida%2Fgo-grpc-server-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbryopsida%2Fgo-grpc-server-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryopsida%2Fgo-grpc-server-template/lists"}