plugins

package
Version: v0.0.0-...-4fdcf46 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Plugins              = make(map[string]*Plugin)
	PluginsWithScheduler = make(map[string]*PluginScheduler)
)

插件map和调度器map

Functions

func AddNewPlugins

func AddNewPlugins(newPlugins map[string]*Plugin)

添加同步时增加的plugin

func ClearAllPlugins

func ClearAllPlugins()

func DelNoUsePlugins

func DelNoUsePlugins(newPlugins map[string]*Plugin)

删除不需要的plugin

func ListPlugins

func ListPlugins(relativePath string) map[string]*Plugin

key: sys/ntp/60_ntp.py

func PluginRun

func PluginRun(plugin *Plugin)

Types

type Plugin

type Plugin struct {
	FilePath string
	MTime    int64
	Cycle    int
}

插件信息: 路径、修改时间、运行周期(来自plugin插件)

type PluginScheduler

type PluginScheduler struct {
	Ticker *time.Ticker
	Plugin *Plugin
	Quit   chan struct{}
}

func NewPluginScheduler

func NewPluginScheduler(p *Plugin) *PluginScheduler

func (*PluginScheduler) Schedule

func (this *PluginScheduler) Schedule()

func (*PluginScheduler) Stop

func (this *PluginScheduler) Stop()

Jump to

Keyboard shortcuts

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