Documentation
¶
Overview ¶
Package plugins
Provide API to access plugins information ¶
swagger:meta
Index ¶
- Constants
- func CheckExtension(filename string) (string, error)
- func UncompressFile(src, dest string) error
- func UploadFile(r *http.Request) (string, string, error)
- type Backend
- type Configuration
- type Frontend
- type Manager
- func (m *Manager) Add(plugin *Plugin)
- func (m *Manager) Commit() error
- func (m *Manager) Get(eltName string) (*Plugin, error)
- func (m *Manager) GetAll() []Plugin
- func (m *Manager) GetConfig() interface{}
- func (m *Manager) GetConfiguration() *Configuration
- func (m *Manager) GetPosition(plugin *Plugin) int
- func (m *Manager) GetSaveFilePath() (string, string, string)
- func (m *Manager) LoadFromDB()
- func (m *Manager) RemoveFromDB(plugin *Plugin)
- type Plugin
- type Props
- type Service
- func (s *Service) AddHandler(w http.ResponseWriter, r *http.Request)
- func (m *Service) GetAllHandler(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetConfigHandler(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetHandler(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetManager() *Manager
Constants ¶
const PLUGINS_CONFIG_FILENAME string = "plugins.json"
const PLUGINS_CONFIG_PATH string = "data"
const PLUGINS_FOLDER string = "plugins"
const PLUGINS_TEMPORARY_FOLDER string = "uploadedfiles"
Variables ¶
This section is empty.
Functions ¶
func CheckExtension ¶
Return extension of the file or an error if the extension is not supported by this program
func UncompressFile ¶
Types ¶
type Backend ¶
type Backend struct {
Dockerimage string `json:"dockerimage"`
Port int `json:"port"`
Props map[string]interface{} `json:"props"`
}
func NewBackend ¶
func NewBackend() *Backend
type Configuration ¶
type Configuration struct {
Plugins []Plugin `json:"plugins"`
}
PluginsConfiguration encapsulates all configuration data
swagger:model
func NewConfiguration ¶
func NewConfiguration() *Configuration
type Frontend ¶
func NewFrontend ¶
func NewFrontend() *Frontend
type Manager ¶
type Manager struct {
ConfigPath string
ConfigFileName string
ConfigFullpath string
Config *Configuration
}
func NewManager ¶
func (*Manager) GetConfiguration ¶
func (m *Manager) GetConfiguration() *Configuration
func (*Manager) GetPosition ¶
GetPluginPosition Return position of a plugin in the list
func (*Manager) LoadFromDB ¶
func (m *Manager) LoadFromDB()
LoadPlugins loads plugins configuration from DB and store it in memory
func (*Manager) RemoveFromDB ¶
RemovePlugin Remove plugin from memory and commit
type Plugin ¶
type Plugin struct {
EltName string `json:"eltName"`
Name string `json:"name"`
Description string `json:"description"`
Frontend Frontend `json:"frontend"`
Backend Backend `json:"backend"`
}
Plugin represents a plugin configuration
swagger:model
type Service ¶
type Service struct {
Manager *Manager
}
func NewService ¶
func NewService() *Service
func (*Service) AddHandler ¶
func (s *Service) AddHandler(w http.ResponseWriter, r *http.Request)
func (*Service) GetAllHandler ¶
func (m *Service) GetAllHandler(w http.ResponseWriter, r *http.Request)
swagger:route GET /plugins GetAllHandler
Gets information of all plugins
Produces: - application/json Schemes: http, https
func (*Service) GetConfigHandler ¶
func (s *Service) GetConfigHandler(w http.ResponseWriter, r *http.Request)
swagger:route GET /plugins/config GetConfigHandler
Gets information of all plugins
Produces: - application/json Schemes: http, https
func (*Service) GetHandler ¶
func (s *Service) GetHandler(w http.ResponseWriter, r *http.Request)
swagger:route GET /plugins/{idMedia} GetHandler
Gets information of a plugin
Produces: - application/json Schemes: http, https
swagger:parameters idPlugin