https://github.com/lil5/goscope2
https://github.com/lil5/goscope2
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lil5/goscope2
- Owner: lil5
- License: mpl-2.0
- Created: 2023-03-04T03:54:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-28T13:11:38.000Z (about 2 years ago)
- Last Synced: 2024-12-26T18:16:36.650Z (5 months ago)
- Language: HTML
- Size: 367 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GoScope2
The second iteration from where josep left off
A log tracker, with a basic ui.
Requireds golangs **gin** http framework and web **api calls**.
## Basic Usage
```golang
package mainimport (
"github.com/gin-gonic/gin"
"github.com/lil5/goscope2"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)func main() {
flag.Parse()
db, _ := gorm.Open(sqlite.Open("test.db"), &gorm.Config{})
r := gin.New()
gs := goscope2.New(goscope2.GoScope2{
DB: db,
JsToken: "104365",
LimitLogs: 3000,
AuthUser: "admin",
AuthPass: "admin",
})gs.AddRoutes(&r.RouterGroup)
r.Use(gs.AddGinMiddleware(http.StatusOK))gs.Infof("Run info")
gs.Warningf("Run warning")
gs.Errorf("Run error")
// goscope2.Fatalf("Run fatal")r.Run("localhost:8080")
}
```## License
Mozilla Public License 2.0