Exemple #1
0
//Meta returns meta data for testing
func Meta() *plugin.PluginMeta {
	return plugin.NewPluginMeta(
		Name,
		Version,
		Type,
		[]string{plugin.SnapGOBContentType},
		[]string{plugin.SnapGOBContentType},
		plugin.CacheTTL(100*time.Millisecond),
	)
}
Exemple #2
0
//Meta returns meta data for testing
func Meta() *plugin.PluginMeta {
	return plugin.NewPluginMeta(
		Name,
		Version,
		Type,
		[]string{plugin.SnapGOBContentType},
		[]string{plugin.SnapGOBContentType},
		plugin.Unsecure(true),
		plugin.RoutingStrategy(plugin.DefaultRouting),
		plugin.CacheTTL(1100*time.Millisecond),
	)
}
// plugin bootstrap
func main() {
	p, err := iostat.New()
	if err != nil {
		panic(err)
	}
	plugin.Start(
		plugin.NewPluginMeta(
			iostat.Name,
			iostat.Version,
			iostat.Type,
			[]string{},
			[]string{plugin.SnapGOBContentType},
			plugin.Exclusive(true),
			plugin.CacheTTL(1*time.Second),
		),
		p,
		os.Args[1],
	)
}