generated from wisdom-oss/microservice-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from wisdom-oss/housekeeping
updating readme and docker image build
- Loading branch information
Showing
2 changed files
with
27 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,23 @@ | ||
<div align="center"> | ||
<img height="150px" src="https://raw.githubusercontent.com/wisdom-oss/brand/main/svg/standalone_color.svg"> | ||
<h1>Microservice Template/Example</h1> | ||
<h3>service-example</h3> | ||
<p>π A minimal working example for microservices in the WISdoM Architecture</p> | ||
<img src="https://img.shields.io/github/go-mod/go-version/wisdom-oss/microservice-template?style=for-the-badge" | ||
alt="Go Lang Version"/> | ||
<h1>Smartmeter Data Management</h1> | ||
<h3>service-smartmeter-rest</h3> | ||
<p>π§ data management for smart meters</p> | ||
<img src="https://img.shields.io/github/go-mod/go-version/wisdom-oss/service-smartmeter-rest?style=for-the-badge" alt="Go Lang Version"/> | ||
<a href="openapi.yaml"> | ||
<img src="https://img.shields.io/badge/Schema%20Version-3.0.0-6BA539?style=for-the-badge&logo=OpenAPI%20Initiative" alt="Open | ||
API Schema Version"/></a> | ||
<img src="https://img.shields.io/badge/Schema%20Version-3.0.0-6BA539?style=for-the-badge&logo=OpenAPI%20Initiative" alt="OpenAPI Schema Version"/> | ||
</a> | ||
<a href="https://github.com/wisdom-oss/service-smartmeter-rest/pkgs/container/service-smartmeter-rest"> | ||
<img alt="Static Badge" src="https://img.shields.io/badge/ghcr.io-wisdom--oss%2Fservice--smartmeter--rest-2496ED?style=for-the-badge&logo=docker&logoColor=white&labelColor=555555"> | ||
</a> | ||
</div> | ||
|
||
## Using the template | ||
1. Download this archive as `.zip` or `.tar.gz` (whatever you prefer) | ||
> [!NOTE] | ||
> This service does not interact with smart meters and their configuration as | ||
> this should only be done by authorized personnel. | ||
2. Extract the downloaded archive to a directory of your choice and remove the | ||
parent folders which may have been created during the download | ||
|
||
3. Make sure that your folder now contains at least the following file structure: | ||
``` | ||
βββ globals | ||
β βββ connections.go (contains globally available connections) | ||
β βββ variables.go (contains globally available variables) | ||
βββ resources | ||
β βββ authConfig.json (contains auth config) | ||
β βββ environment.json (contains the environment setup) | ||
β βββ errors.json (contains http errors) | ||
β βββ queries.sql (contains sql queries for the service) | ||
βββ routes | ||
β βββ templates.go (contains three template routes) | ||
βββ .gitignore | ||
βββ init.go (contains code used during startup) | ||
βββ template-service.go (contains the bootstrapping code for the service) | ||
βββ go.mod (contains the dependencies of the service) | ||
βββ go.sum (is the lockfile for the dependencies) | ||
``` | ||
|
||
4. **Important** Change the service name | ||
|
||
To change the service name, you need to edit the file `globals/variables.go` | ||
which should contain the following line | ||
|
||
```go | ||
const ServiceName = "template-service" | ||
``` | ||
|
||
This line needs to be changed to your service name. This constant is | ||
used in logs and error handling to identify the service. | ||
|
||
5. Initialize a Git Repository with `main` as default branch | ||
|
||
```shell | ||
git init -b main | ||
``` | ||
6. Add all files to the repository | ||
|
||
```shell | ||
git add -A | ||
``` | ||
|
||
7. Commit the template to the repository | ||
|
||
```shell | ||
git commit -m "loading wisdom-oss/microservice-template" | ||
``` | ||
|
||
8. Set up a remote origin for the repository | ||
|
||
```shell | ||
git remote add origin <your-remote-url> | ||
``` | ||
|
||
9. Push the repository to the remote origin | ||
|
||
```shell | ||
git push origin main | ||
``` | ||
|
||
10. :tada: You are now able to develop your new microservice | ||
|
||
11. Change the README to the contents you desire in here | ||
This microservice allows the management of smart meter data that has been | ||
written into the database. | ||
Furthermore, the service provides an endpoint allowing external services to | ||
write collected smart meter data into the database, either as a batch operation | ||
or writing single entries. |