-
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.
- Loading branch information
Showing
2 changed files
with
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,14 @@ | ||
# Hello World App | ||
# Go Hello World Sample App | ||
|
||
## Introduction | ||
## Disclaimer | ||
|
||
This is simple Hello World Golang application with following three endpoints. | ||
> ⚠️ **Important Disclaimer:** | ||
> The link below is accessible only to those who | ||
> **already have full access** to the EIAP Ecosystem. | ||
> If you do not have this access, **please do not proceed.** | ||
- **/hello** is a sample endpoint | ||
Go Hello World Sample App Documentation [Here](https://developer.intelligentautomationplatform.ericsson.net/#tutorials/sample-app-in-go). | ||
|
||
- **/health** is an endpoint for an external agent to monitor the app's liveliness | ||
|
||
- **/metrics** presents number of successful and failed invocations | ||
of the '/hello' endpoint | ||
|
||
## Build | ||
|
||
Export the environment variable to build the binary. | ||
defines the operating system for which to compile the golang code. | ||
Examples are linux, windows, darwin etc. | ||
|
||
```bash | ||
export GOOS="linux" | ||
``` | ||
|
||
Run the following command for creating the binary file. You can specify the | ||
executable file by using [-o] flag. And in our example the executable is | ||
target/eric-oss-hello-world-app. | ||
|
||
**mod=vendor** flag constructs a directory named vendor in the root | ||
directory that contains copies of all packages needed to support builds | ||
and tests of packages in the src module. | ||
|
||
```bash | ||
go build -mod=vendor -o target/eric-oss-hello-world-go-app ./src | ||
``` | ||
|
||
## Run | ||
|
||
**Note:** The following procedure might not work on Windows. | ||
If you have issues, try using a Linux terminal with WSL to execute the binary file. | ||
|
||
Provide Execute Permissions to the Binary File | ||
|
||
```bash | ||
sudo chmod +x target/eric-oss-hello-world-go-app | ||
``` | ||
|
||
Execute the Hello World Application | ||
|
||
```bash | ||
./target/eric-oss-hello-world-go-app | ||
``` | ||
|
||
Make a Request to **/hello** Endpoint | ||
|
||
```bash | ||
curl -is localhost:8050/hello | ||
``` | ||
|
||
Example Output: | ||
|
||
```python | ||
HTTP/1.1 200 OK | ||
Date: Thu, 17 Jun 2021 14:46:46 GMT | ||
Content-Length: 13 | ||
Content-Type: text/plain; charset=utf-8 | ||
|
||
Hello World!! | ||
``` | ||
|
||
## Test | ||
|
||
Execute the unit testcases | ||
|
||
```bash | ||
go test -v ./src | ||
``` | ||
|
||
For specific unit test case command: | ||
|
||
```bash | ||
go test -v --run [TESTCASE_NAME] .\src\ | ||
``` | ||
|
||
Hello World APP SDK Documentation [Here](https://developer.intelligentautomationplatform.ericsson.net/#tutorials/go-sample-app). | ||
**Note:** | ||
If you need help accessing the EIAP Ecosystem, | ||
contact support at this **email address:** intelligent.automation.platform@ericsson.com |
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 +1 @@ | ||
3.0.0 | ||
4.0.1 |