main API

main

package

API reference for the main package.

S
struct

samplePlugin

examples/basic/main.go:5-5
type samplePlugin struct

Methods

Name
Method

Returns

string
func (samplePlugin) Name() string
{ return "sample" }
Start
Method

Returns

error
func (samplePlugin) Start() error
{ return nil }
Stop
Method

Returns

error
func (samplePlugin) Stop() error
{ return nil }
F
function

main

examples/basic/main.go:11-19
func main()

{
	registry := plugin.NewRegistry()
	if err := registry.Register(samplePlugin{}); err != nil {
		panic(err)
	}

	_ = registry.StartAll()
	_ = registry.StopAll()
}