plugin

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	*config.PluginConfig

	ManifestVersion int      `json:"manifest_version"`
	Name            string   `json:"name"`
	Description     string   `json:"description"`
	Author          string   `json:"author"`
	Version         string   `json:"version"`
	HomePage        string   `json:"homepage"`
	Color           string   `json:"color"`
	DocsURL         string   `json:"docs_url"`
	DownloadURL     string   `json:"download_url"`
	Matches         []string `json:"matches"`
	Type            string   `json:"type"`     // downloader/other
	Location        string   `json:"location"` // 软件执行文件全名
	State           int      `json:"state"`    // 1.运行中 2.运行中 尚未检测通信结果 3.未启动
	Port            int      `json:"port"`
	PID             int      `json:"pid"`
	Service         pb.DownloadServiceClient
	// contains filtered or unexported fields
}

func New

func New(baseDir string) *Plugin

func StopPlugin

func StopPlugin(p *Plugin) (*Plugin, error)

停止插件

func (*Plugin) Init

func (p *Plugin) Init() error

初始化/更新插件配置

func (*Plugin) InjectMetadata

func (p *Plugin) InjectMetadata(ctx context.Context) context.Context

func (*Plugin) Run

func (p *Plugin) Run(c *config.Config) error

启动插件

func (*Plugin) Update

func (p *Plugin) Update() error

Jump to

Keyboard shortcuts

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