Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Folder Structure] Follow standard Go project Layout #209

Closed
tiokim opened this issue Dec 31, 2020 · 7 comments · Fixed by #282
Closed

[Folder Structure] Follow standard Go project Layout #209

tiokim opened this issue Dec 31, 2020 · 7 comments · Fixed by #282
Assignees
Labels
help wanted Extra attention is needed refactoring Any tasks and issues w.r.t. the code refactoring
Projects

Comments

@tiokim
Copy link
Contributor

tiokim commented Dec 31, 2020

There is a popular standard Go application project layout and many projects follow it.
I think we should change the folder structure in terms of this guide like below.

  • GoMain/src/main > cmd
  • Buillder > build
  • samples > examples
  • samples/datastorage > configs/datastorage
  • src > internal
  • doc > docs
  • doc/edge_orchestration_api.yaml and doc/edge_orchestration_api_secure.yaml > api/...

Please add or rectify the list above since it might be incorrect!

@tiokim tiokim added refactoring Any tasks and issues w.r.t. the code refactoring help wanted Extra attention is needed labels Dec 31, 2020
@MoonkiHong
Copy link
Contributor

@t25kim 100% agree with you. We should follow the so-called de-facto standard in GoLang projects. Plus, it is quite straightforward to indicate where we should refer to in terms of api as you suggested.

@sun-sharma
Copy link
Contributor

Hi, Please recommend if this is the correct way of going forward with this. (Data Storage and MNEDC part)

Creating 2 new folders : "examples" and "configs" in the main repo and using this tree


--examples
----------------datastorage
----------------------sample-json-device.yaml

--configs
----------------datastorage
------------------------configuration.toml
-----------------mnedc
-------------------------client.config

Also, I can do one of the following.

  1. Move "native" folder in samples to examples and delete the samples folder
  2. Or, Leave the native folder in samples only to move later.

@tiokim
Copy link
Contributor Author

tiokim commented Jan 19, 2021

Hi, Please recommend if this is the correct way of going forward with this. (Data Storage and MNEDC part)

Creating 2 new folders : "examples" and "configs" in the main repo and using this tree


--examples
----------------datastorage
----------------------sample-json-device.yaml

--configs
----------------datastorage
------------------------configuration.toml
-----------------mnedc
-------------------------client.config

@sun-sharma Thank you for the idea!

When it comes to datastorage,

  • looks good to me to go with configs/datastorage/
  • yaml files should be in the same folder as configuration.toml since yaml files should be aligned with the detail of configuration.toml.
  • We should implement configuration.toml and yaml files according to home edge scenario since they are not examples.

When it comes to mnedc,

  • client.config should be changed according to user network status, I think it should be in the examples/mnedc

@tiokim
Copy link
Contributor Author

tiokim commented Jan 19, 2021

Also, I can do one of the following.

1. Move "native" folder in samples to examples and delete the samples folder

2. Or,  Leave the native folder in samples only to move later.

I like to go with option 1!

@suresh-lc
Copy link
Contributor

When it comes to mnedc,

client.config should be changed according to user network status, I think it should be in the examples/mnedc

But this is the configuration of where the mnedc server is running. Hence thought if it goes to config folder would be appropriate.

@tiokim
Copy link
Contributor Author

tiokim commented Jan 19, 2021

When it comes to mnedc,

client.config should be changed according to user network status, I think it should be in the examples/mnedc

But this is the configuration of where the mnedc server is running. Hence thought if it goes to config folder would be appropriate.

Make sense! since configuration file templates or default configs could be in a config folder.
How about transforming client.config into a yaml applied template and putting it in like LINK?

MoonkiHong pushed a commit that referenced this issue Feb 10, 2021
…#259)

Signed-off-by: Taewan Kim <t25.kim@samsung.com>

- This PR is intended to refactor folder structures by Standard Go Project Layout (Related #209).
MoonkiHong pushed a commit that referenced this issue Feb 18, 2021
#267)

Signed-off-by: Taewan Kim <t25.kim@samsung.com>

- This PR is intended to refactor folder structures by Standard Go Project Layout (Related #209).
MoonkiHong pushed a commit that referenced this issue Feb 24, 2021
Signed-off-by: Taewan Kim <t25.kim@samsung.com>

- This PR is intended to refactor folder structures by Standard Go Project Layout (Related #209).
- Security hotspot issue (from SonarCloud analysis) will be resolved in conjunction with the issue #273.
@tiokim
Copy link
Contributor Author

tiokim commented Feb 24, 2021

Closing this since this issue is resolved.

@tiokim tiokim closed this as completed Feb 24, 2021
@tiokim tiokim added this to Done in Refactoring Feb 25, 2021
@tiokim tiokim moved this from Done to In progress in Refactoring Feb 25, 2021
@tiokim tiokim moved this from In progress to Done in Refactoring Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment