appplugsys

package module
v0.0.0-...-4e53584 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppPlugSys

type AppPlugSys struct {
	// contains filtered or unexported fields
}

func NewAppPlugSys

func NewAppPlugSys(
	db *gorm.DB,
	getPluginDB func(*DBPluginInfo) (*gorm.DB, bool, bool, error),
	plugin_searcher PluginSearcherI,
) (*AppPlugSys, error)

func (*AppPlugSys) AcceptPlugin

func (self *AppPlugSys) AcceptPlugin(plugwrap *PluginWrap) error

func (*AppPlugSys) ApplicationInfoTable

func (self *AppPlugSys) ApplicationInfoTable() []*AppPlugSysApplicationDisplayItem

func (*AppPlugSys) DisplayApplication

func (self *AppPlugSys) DisplayApplication(plugin_name string, name string) error

func (*AppPlugSys) GetPluginByName

func (self *AppPlugSys) GetPluginByName(name string) (ret *PluginWrap, err error)

func (*AppPlugSys) PluginInfoTable

func (self *AppPlugSys) PluginInfoTable() map[string]*AppPlugSysPluginDisplayItem

func (*AppPlugSys) RemovePlugin

func (self *AppPlugSys) RemovePlugin(name string) error

type AppPlugSysApplicationDisplayItem

type AppPlugSysApplicationDisplayItem struct {
	Title       string
	Icon        []byte
	PluginName  string
	Name        string
	Description string
}

type AppPlugSysIface

type AppPlugSysIface struct {
	// contains filtered or unexported fields
}

func NewAppPlugSysIface

func NewAppPlugSysIface(plugin_wrap *PluginWrap) (*AppPlugSysIface, error)

func (*AppPlugSysIface) GetPlugin

func (self *AppPlugSysIface) GetPlugin(name string) (*Plugin, error)

func (*AppPlugSysIface) GetPluginApplication

func (self *AppPlugSysIface) GetPluginApplication(plugname string, name string) (*PluginApplication, error)

func (*AppPlugSysIface) GetPluginApplicationController

func (self *AppPlugSysIface) GetPluginApplicationController(plugname string, name string) (interface{}, error)

func (*AppPlugSysIface) GetPluginController

func (self *AppPlugSysIface) GetPluginController(name string) (interface{}, error)

type AppPlugSysPluginDisplayItem

type AppPlugSysPluginDisplayItem struct {
	Name         string
	Sha512       string
	BuiltIn      bool
	Found        bool
	Enabled      bool
	AutoStart    bool
	WorkerStatus string
	LastDBReKey  time.Time
}

type AppViewI

type AppViewI interface {
	Clear()
	SetApplication(title, plugin_name, name string)
	RmApplication(plugin_name, name string)
}

type BasicPluginInfo

type BasicPluginInfo struct {
	Name    string
	BuiltIn bool
	Sha512  string
}

type DBPluginInfo

type DBPluginInfo struct {
	Name        string `gorm:"primary_key"`
	BuiltIn     bool
	Sha512      string
	Enabled     bool
	LastDBReKey time.Time
	Key         string
}

func (DBPluginInfo) TableName

func (DBPluginInfo) TableName() string

type Plugin

type Plugin struct {
	Name        string
	Title       string
	Description string

	Icon []byte

	Requires []string // unique names of required plugins

	Init    func(iface *AppPlugSysIface, db *gorm.DB) error
	Destroy func() error

	Worker *worker.Worker // set this to nil, if plugin does not support this

	GetController func() interface{}

	Display func() error // set this to nil, if plugin does not support this

	Applications map[string]*PluginApplication
}

type PluginApplication

type PluginApplication struct {
	Name        string
	Title       string
	Description string

	Icon []byte

	Worker *worker.Worker

	GetController func() interface{}

	Display func() error // set this to nil, if app does not support this
}

type PluginSearcherI

type PluginSearcherI interface {
	FindAll() ([]*PluginSearcherSearchResultItem, error)
	FindBuiltIn(name string) (*PluginSearcherSearchResultItem, error)
	FindBySha512(sha512 string) (*PluginSearcherSearchResultItem, error)
}

type PluginSearcherSearchResultItem

type PluginSearcherSearchResultItem struct {
	BasicPluginInfo
	Path   string
	Plugin *Plugin
}

type PluginWrap

type PluginWrap struct {
	BasicPluginInfo
	Enabled     bool
	LastBDReKey time.Time

	Plugin *Plugin
	// contains filtered or unexported fields
}

func NewPluginWrapFromSearchItem

func NewPluginWrapFromSearchItem(
	psri *PluginSearcherSearchResultItem,
	sys *AppPlugSys,
) (*PluginWrap, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL