Skip to content

Commit

Permalink
Updated README and version (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
don2112e committed Sep 18, 2024
1 parent b140069 commit 80db575
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 81 deletions.
90 changes: 10 additions & 80 deletions README.md
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
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0
4.0.1

0 comments on commit 80db575

Please sign in to comment.