You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-27Lines changed: 9 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ This repository provides a template for building a RESTful API using Go with fea
17
17
## Folder structure
18
18
19
19
```
20
-
my-rest-api/
20
+
golang-rest-api-template/
21
21
|-- bin/
22
22
|-- cmd/
23
23
| |-- server/
@@ -30,12 +30,6 @@ my-rest-api/
30
30
| |-- user.go
31
31
| |-- database/
32
32
| |-- db.go
33
-
|-- internal/
34
-
| |-- utils/
35
-
| |-- helper.go
36
-
|-- web/
37
-
| |-- static/
38
-
| |-- templates/
39
33
|-- scripts/
40
34
|-- Dockerfile
41
35
|-- go.mod
@@ -47,31 +41,19 @@ my-rest-api/
47
41
48
42
1.**`bin/`**: Contains the compiled binaries.
49
43
50
-
2.**`cmd/`**: Main applications for this project. The directory name for each application should match the name of the executable you want to generate.
44
+
2.**`cmd/`**: Main applications for this project. The directory name for each application should match the name of the executable.
51
45
52
-
-**`main.go`**: The entry point for your application.
46
+
-**`main.go`**: The entry point.
53
47
54
48
3.**`pkg/`**: Libraries and packages that are okay to be used by applications from other projects.
55
49
56
-
-**`api/`**: All your API logic.
57
-
-**`handler.go`**: Your HTTP handlers.
58
-
-**`router.go`**: Your routes.
59
-
-**`models/`**: Your data models.
50
+
-**`api/`**: API logic.
51
+
-**`handler.go`**: HTTP handlers.
52
+
-**`router.go`**: Routes.
53
+
-**`models/`**: Data models.
60
54
-**`database/`**: Database connection and queries.
61
55
62
-
4.**`internal/`**: Private application and library code. This is code you don't want others importing in their applications or libraries.
63
-
64
-
-**`utils/`**: Various utilities that you use internally.
65
-
66
-
5.**`web/`**: All your web server related things like static files, templates, etc.
67
-
68
-
6.**`scripts/`**: Various build, install, analysis, etc., scripts for your application.
69
-
70
-
7.**`Dockerfile`**: If you use Docker, you'll include a Dockerfile here.
71
-
72
-
8.**`go.mod` and `go.sum`**: The Go module file and its checksum.
73
-
74
-
9.**`README.md`**: Project documentation and setup guide.
56
+
4.**`scripts/`**: Various build, install, analysis, etc., scripts.
0 commit comments