https://github.com/syndicatefoundation/ginwrapper
A Library designed to simplify gin library
https://github.com/syndicatefoundation/ginwrapper
gin ginwrapper golang network networking wrapper
Last synced: 17 days ago
JSON representation
A Library designed to simplify gin library
- Host: GitHub
- URL: https://github.com/syndicatefoundation/ginwrapper
- Owner: SyNdicateFoundation
- License: other
- Created: 2025-08-11T13:40:54.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-11-02T20:04:51.000Z (7 months ago)
- Last Synced: 2025-11-02T21:18:40.303Z (7 months ago)
- Topics: gin, ginwrapper, golang, network, networking, wrapper
- Language: Go
- Homepage:
- Size: 134 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GinWrapper
# Usage
To use GinWrapper you need to have GOLang installed on your system. You can download and install GOLang from the official website: [https://go.dev/](https://go.dev/).
Once you have GOLang installed, you can now use GinWrapper in your project:
```go
import (
"github.com/SyNdicateFoundation/GinWrapper/"
)
```
then in your main.go you should define your HttpsServer:
```go
var (
HttpsServer httpscore.HttpsServer
)
```
Now, you need to setup logger and configuration as well as responses:
```go
func main() {
logger.SetupLogger("Your Project Name")
// Adjust as needed
configuration.DefaultConfig =
configuration.Holder{
Debug: false,
HTTPSServer: configuration.HTTPSServer{
Enabled: true,
Address: "0.0.0.0",
Port: 2009,
APIUserAgent: "LiteGuard Client 1.0/b (Software)",
TlsConfiguration: configuration.HttpsTlsConfiguration{
Enable: false,
CertFile: "cert.pem",
KeyFile: "key.pem",
},
},
}
// setup configuration
configuration.SetupConfig("config.toml")
// add responses
httpscore.Responses["index"] = httpscore.Response{
Fn: func(c *gin.Context) {
c.HTML(http.StatusOK, "index.html", nil)
},
Method: "GET",
Addresses: []string{"/", "/index.html"},
}
httpscore.Responses["projects"] = httpscore.Response{
Fn: func(c *gin.Context) {
c.HTML(http.StatusOK, "projects.html", nil)
},
Method: "GET",
Addresses: []string{"/projects", "/projects.html"},
}
httpscore.Responses["projects"] = httpscore.Response{
Fn: func(c *gin.Context) {
c.HTML(http.StatusOK, "members.html", nil)
},
Method: "GET",
Addresses: []string{"/members", "/members.html"},
}
httpscore.Responses["technologies"] = httpscore.Response{
Fn: func(c *gin.Context) {
c.HTML(http.StatusOK, "technologies.html", nil)
},
Method: "GET",
Addresses: []string{"/technologies", "/technologies.html"},
}
httpscore.Responses["colleagues"] = httpscore.Response{
Fn: func(c *gin.Context) {
c.HTML(http.StatusOK, "colleagues.html", nil)
},
Method: "GET",
Addresses: []string{"/colleagues", "/colleagues.html"},
}
// first argument is templateDir and second one is assetsDir
HttpsServer.ListenAndServe("assets/templates/*", "/assets")
}
```
## Contribution Guidelines 🤝
Feel free to contribute to the development of our project. we will notice it.