Skip to content

wisdom-oss/service-groundwater-levels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Microservice Template/Example

service-example

πŸ“ A minimal working example for microservices in the WISdoM Architecture

Go Lang Version Open
API Schema Version

Using the template

  1. Download this archive as .zip or .tar.gz (whatever you prefer)

  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

    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

    git init -b main
  6. Add all files to the repository

    git add -A
  7. Commit the template to the repository

    git commit -m "loading wisdom-oss/microservice-template"
  8. Set up a remote origin for the repository

    git remote add origin <your-remote-url>
  9. Push the repository to the remote origin

    git push origin main
  10. πŸŽ‰ You are now able to develop your new microservice

  11. Change the README to the contents you desire in here

About

🌊 read collected water levels

Resources

Stars

Watchers

Forks

Releases

No releases published