Slowly migrating struct methods to their own models for association.

This commit is contained in:
Ada Werefox 2025-04-27 20:38:07 -07:00
parent 739a2f74eb
commit 9505c479e8

View file

@ -1,9 +1,10 @@
package main package main
import ( import (
"log"
api "example.com/api" api "example.com/api"
authdiscord "example.com/auth/discord" authdiscord "example.com/auth/discord"
configserver "example.com/config/server"
databasecommands "example.com/database/commands" databasecommands "example.com/database/commands"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
@ -11,8 +12,8 @@ import (
func main() { func main() {
api.GlobalDatabase = databasecommands.InitializeDatabase() api.GlobalDatabase = databasecommands.InitializeDatabase()
api.GlobalConfig = configserver.ParseConfig("../config.toml")
api.GlobalOAuth = authdiscord.CreateDiscordOAuthConfig(api.GlobalConfig) api.GlobalOAuth = authdiscord.CreateDiscordOAuthConfig(api.GlobalConfig)
log.Println(api.GlobalConfig)
app := gin.Default() app := gin.Default()
// Authentication Workflow // Authentication Workflow
app.GET("/auth/callback", api.AuthCallback) app.GET("/auth/callback", api.AuthCallback)
@ -26,13 +27,10 @@ func main() {
// Read // Read
app.GET("/get/user/info", api.GetUserInfo) app.GET("/get/user/info", api.GetUserInfo)
app.GET("/get/user/authorized", api.GetIsUserAuthorized) app.GET("/get/user/authorized", api.GetIsUserAuthorized)
app.GET("/get/group", api.GetDatabaseGroup)
app.GET("/get/groups", api.GetDatabaseGroups) app.GET("/get/groups", api.GetDatabaseGroups)
app.GET("/get/all/groups", api.GetAllDatabaseGroups) app.GET("/get/all/groups", api.GetAllDatabaseGroups)
app.GET("/get/function", api.GetDatabaseFunction)
app.GET("/get/functions", api.GetDatabaseFunctions) app.GET("/get/functions", api.GetDatabaseFunctions)
app.GET("/get/all/functions", api.GetAllDatabaseFunctions) app.GET("/get/all/functions", api.GetAllDatabaseFunctions)
app.GET("/get/function-tag", api.GetDatabaseFunctionTag)
app.GET("/get/function-tags", api.GetDatabaseFunctionTags) app.GET("/get/function-tags", api.GetDatabaseFunctionTags)
app.GET("/get/all/function-tags", api.GetAllDatabaseFunctionTags) app.GET("/get/all/function-tags", api.GetAllDatabaseFunctionTags)
// Delete // Delete