Documentation ¶
Overview ¶
The program is use the agent to schedule the plugin. The return value of the plugin is stored in the result channel. There will be a pool of transaction that used to store the plugin that is running. The transaction will be executed in parallel.
Description: This is the Go function that frontend can call for. Author: Hughie21 Date: 2024-09-16 license that can be found in the LICENSE file.
Description: the core package is the core of the program, it is used to manage the configuration, the agent, and the logger. Author: Hughie21 Date: 2024-11-21 license that can be found in the LICENSE file.
Index ¶
- Constants
- func FileOpenDialog(app *App, displayName string, pattern string) string
- func FileSaveDialog(app *App, filename string, pattern string) string
- type Agent
- type App
- func (a *App) Base64Decode(str string) string
- func (a *App) Base64Encode(str string) string
- func (a *App) DirectLoading() Message
- func (a *App) FileDelete(name string) Message
- func (a *App) FileOpen() Message
- func (a *App) FileSave(name string, rawJson string, skip bool) Message
- func (a *App) Fr(path string) string
- func (a *App) GetConfig(sector string, key string) Message
- func (a *App) GetImageData(filename string) Message
- func (a *App) GetStaticResources() Message
- func (a *App) GetVersion()
- func (a *App) ImageDownload(url string) Message
- func (a *App) ImageUpload() ImageFIle
- func (a *App) LoadImage(data string) Message
- func (a *App) NewFile() Message
- func (a *App) OpenImage() Message
- func (a *App) SetConfig(sector string, key string, value string) Message
- func (a *App) Trace(source, stack string)
- type Core
- type EpubReader
- type EpubWriter
- type ImageFIle
- type Message
- type PluginInfo
- type Pluginer
- type Result
- type Transaction
Constants ¶
const ( TransactionStateWaiting = iota TransactionStateRunning )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is a manager for all plugins, so there is map that store all the registered plugins. The context that carraied by the agent is used to cancel the plugin when the app is shutdown. The timeout that represent the time to wait for the plugin to find a empty transaction.
type App ¶
type App struct {
// contains filtered or unexported fields
}
App struct
func (*App) Base64Decode ¶
func (*App) Base64Encode ¶
func (*App) DirectLoading ¶
func (*App) FileDelete ¶
corresponding to the "Delete" button on the "insert picture"
func (*App) GetImageData ¶
get the base64 string of the image
func (*App) GetStaticResources ¶
get the static resources list of the loacl server
func (*App) GetVersion ¶
func (a *App) GetVersion()
func (*App) ImageDownload ¶
func (*App) ImageUpload ¶
corresponding to the "Upload" button on the "insert picture"
type EpubReader ¶
type EpubReader struct { PluginInfo // contains filtered or unexported fields }
func NewEpubReader ¶
func NewEpubReader(tempDir string) *EpubReader
type EpubWriter ¶
type EpubWriter struct { PluginInfo // contains filtered or unexported fields }
func NewEpubWriter ¶
func NewEpubWriter(tempDir string) *EpubWriter
type PluginInfo ¶
type PluginInfo struct { Name string Type string Priority int Version string Author string Email string Source string }
func (*PluginInfo) Info ¶
func (p *PluginInfo) Info() PluginInfo
type Pluginer ¶
type Pluginer interface { Run(context.Context, ...interface{}) (interface{}, error) Info() PluginInfo }
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
the result carry the data and error of the plugin
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction() *Transaction