Files
server/model/pluginconf.go
饺子w (Yumechi) 496c166981 chore: Migrate github.com/jinzhu/gorm to gorm.io/gorm (#863)
* chore: Migrate github.com/jinzhu/gorm to gorm.io/gorm

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

* chore: drop singleton connection limit on sqlite3 backend

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

* enhance: database logging

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

* Revert "chore: drop singleton connection limit on sqlite3 backend"

This reverts commit b494a3bd1f.

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

* typo

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

* rename unique_index -> uniqueIndex

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

* drop uniqueIndex on primary key

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

* migrate fully to new gorm tag format

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

* specify unique index name

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

* remove pluginConf duplicate index

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

* disable auto migrate FK

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>

---------

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
2025-10-29 22:23:10 +00:00

70 lines
1.8 KiB
Go

package model
// PluginConf holds information about the plugin.
type PluginConf struct {
ID uint `gorm:"primaryKey;autoIncrement"`
UserID uint
ModulePath string `gorm:"type:text"`
Token string `gorm:"type:varchar(180);uniqueIndex:uix_plugin_confs_token"`
ApplicationID uint
Enabled bool
Config []byte
Storage []byte
}
// PluginConfExternal Model
//
// Holds information about a plugin instance for one user.
//
// swagger:model PluginConf
type PluginConfExternal struct {
// The plugin id.
//
// read only: true
// required: true
// example: 25
ID uint `json:"id"`
// The plugin name.
//
// read only: true
// required: true
// example: RSS poller
Name string `json:"name"`
// The user name. For login.
//
// required: true
// example: P1234
Token string `binding:"required" json:"token" query:"token" form:"token"`
// The module path of the plugin.
//
// example: github.com/gotify/server/plugin/example/echo
// read only: true
// required: true
ModulePath string `json:"modulePath" form:"modulePath" query:"modulePath"`
// The author of the plugin.
//
// example: jmattheis
// read only: true
Author string `json:"author,omitempty" form:"author" query:"author"`
// The website of the plugin.
//
// example: gotify.net
// read only: true
Website string `json:"website,omitempty" form:"website" query:"website"`
// The license of the plugin.
//
// example: MIT
// read only: true
License string `json:"license,omitempty" form:"license" query:"license"`
// Whether the plugin instance is enabled.
//
// example: true
// required: true
Enabled bool `json:"enabled"`
// Capabilities the plugin provides
//
// example: ["webhook","display"]
// required: true
Capabilities []string `json:"capabilities"`
}