oakestra / oakestra-net

Networking component of Oakestra
Apache License 2.0
5 stars 7 forks source link

Golang file naming structure #159

Open smnzlnsk opened 6 months ago

smnzlnsk commented 6 months ago

Short

Establish a file naming convention for golang files

Proposal

Currently the node-net-manager files do not follow a comprehensive file naming structure, which is desirable in any case.

As for golang, there is no documented styleguide for file naming, however general consensus seems to be all lower case, with snake case, where needed, while avoiding snake case suffixes like <file>_arm.go or <file>_linux.go, just like _test.go for tests. (see https://github.com/golang/go/issues/36060)

My proposal is scanning the node-net-manager files and renaming long files to shorter ones where possible, while keeping the filenames as descriptive as possible. Generally a go-esque structure could be the following:

node-net-manager/ ├─ environment/ ├─ proxy/ │ ├─ tunnel.go │ ├─ tunnel_test.go │ ├─ cache.go ├─ mqtt/ │ ├─ tablequery.go │ ├─ handlers.go │ ├─ client.go │ ├─ updates.go ├─ go.mod ├─ go.sum ├─ netmanager.go

Ratio

Better structure and a agreed upon file naming standard for this project

Impact

only file names in node-net-manager

Development time

1 hour

Status

looking for feedback

Checklist

smnzlnsk commented 3 months ago

Bump @giobart @nitindermohan any opinions?

giobart commented 3 months ago

Yes this file names are good to me, just consider that the build script for github workflows needs to be changed as well.

nitindermohan commented 2 months ago

I do agree with Giovanni. I have no particular critique on the file names proposed. Go ahead from my end!

smnzlnsk commented 2 months ago

integrated into #166