Skip to content

Commit

Permalink
README.md updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
alihanyalcin committed Apr 16, 2020
1 parent 47a02e1 commit 9f0cd3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# micGo
**Generate microservice architecture based project with Go less than a second.**

micGo creates a starting point for your microservice-based application and you can only focus to develop your **REST APIs** needed by your business.
You do not need to lose your time to set up a new project. **micGo** creates a starting point for your microservice-based application and you can only focus to develop your **REST APIs** needed by your business.

<img src="micgo.png" align="right" width="300px" alt="micgo logo">

Expand Down
27 changes: 15 additions & 12 deletions base/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# {project}

### Development Tips
**1.** If you want to add new REST APIs to your microservice, go to **_<project_name>/internal/<service_name>/router.go_** file.
**1.** If you want to add new REST APIs to your microservice, go to ```<project_name>/internal/<service_name>/router.go``` file.

**2.** If you want to update Service, Database, Logging or Startup configuration of your microservice, go to **_<project_name>/cmd/<service_name>/res/configuration.toml_** file.
**2.** If you want to update Service, Database, Logging or Startup configuration of your microservice, go to ```<project_name>/cmd/<service_name>/res/configuration.toml``` file.

**3.** If you want to add **new configuration variable**:
* Go to **_<project_name>/internal/pkg/config/types.go_** file, and append your configuration struct:
* Go to ```<project_name>/internal/pkg/config/types.go``` file, and append your configuration struct:
```go
type TestInfo struct {
Start string
End string
}
```
* Create **test.go** file under **_<project_name>/internal/pkg/bootstrap/interfaces_** directory, and create an interface for new configuration:
* Create ```test.go``` file under ```<project_name>/internal/pkg/bootstrap/interfaces``` directory, and create an interface for new configuration:
```go
type Test interface {
// GetTestInfo returns a test information.
GetTestInfo() config.TestInfo
}
```
* Open **_<project_name>/internal/<service_name>/config/config.go_** file, and add new configuration variable to the service, and **GetTestInfo** interface body.
* Open ```<project_name>/internal/<service_name>/config/config.go``` file, and add new configuration variable to the service, and **GetTestInfo** interface body.
```go
// Add Test variable
type ConfigurationStruct struct {
Expand All @@ -37,16 +37,16 @@ func (c *ConfigurationStruct) GetTestInfo() config.TestInfo {
return c.Test
}
```
* Go to **_<project_name>/cmd/<service_name>/res/configuration.toml_** file, and append new configuration:
* Go to ```<project_name>/cmd/<service_name>/res/configuration.toml``` file, and append new configuration:
```toml
[Test]
Start = "Welcome, service start with new configuration"
End = "Bye, service stop with new configuration"
```
**4.** If you want to create **new handler** with **new configuration variable**:
* Go to **_<project_name>/internal/pkg/bootstrap/handlers_** directory, and create **test** directory.
* Create **test.go** file under **_<project_name>/internal/pkg/bootstrap/handlers/test_** directory.
* Add the lines below to **test.go**:
* Go to ```<project_name>/internal/pkg/bootstrap/handlers``` directory, and create **test** directory.
* Create ```test.go``` file under ```<project_name>/internal/pkg/bootstrap/handlers/test``` directory.
* Add the lines below to ```test.go```:
```go
type TestMessage struct {
Message interfaces.Test
Expand Down Expand Up @@ -78,12 +78,15 @@ func (s TestMessage) BootstrapHandler(
return true
}
```
* Then, go to **_<project_name>/cmd/<service_name>/main.go_** file, and append new **BootstrapHandler** to your **microservice**:
* Then, go to ```<project_name>/cmd/<service_name>/main.go``` file, and append new **BootstrapHandler** to your **microservice**:
```go
test.NewBootstrap(configuration).BootstrapHandler,
```
* Start your service, check log files for new message.

**5.** To add **new database methods**.
* Go to **_<project_name>/internal/pkg/db/interfaces/db.go_** file, and append new method to the interface.
* Go to **_<project_name>/internal/pkg/db/mongo_** directory, and create a **.go** file for **a specific microservice**, then implement your method body.
* Go to ```<project_name>/internal/pkg/db/interfaces/db.go``` file, and append new method to the interface.
* Go to ```<project_name>/internal/pkg/db/mongo``` directory, and create a **.go** file for **a specific microservice**, then implement your method body.


**NOTE:** Your project was created with the reorganizing of [this](https://github.com/edgexfoundry/edgex-go) project's source code.

0 comments on commit 9f0cd3d

Please sign in to comment.