How To Use Plugins
Using the third package source code plugin
package main
import (
_ "github.com/GoAdminGroup/go-admin/adapter/gin" // Import the adapter
_ "github.com/GoAdminGroup/themes/adminlte" // Import the theme
_ "github.com/GoAdminGroup/go-admin/modules/db/drivers/mysql" // Import the sql driver
"github.com/gin-gonic/gin"
"github.com/GoAdminGroup/go-admin/engine"
"github.com/GoAdminGroup/go-admin/plugins/admin"
"github.com/GoAdminGroup/go-admin/plugins/example"
"github.com/GoAdminGroup/go-admin/modules/config"
"github.com/GoAdminGroup/go-admin/examples/datamodel"
)
func main() {
r := gin.Default()
eng := engine.Default()
cfg := config.Config{}
adminPlugin := admin.NewAdmin(datamodel.Generators)
examplePlugin := example.NewExample()
eng.AddConfig(cfg).
AddPlugins(adminPlugin, examplePlugin). // loading
Use(r)
r.Run(":9033")
}Using the binary plugin
Last updated