plugin

package
v0.0.0-...-61b8474 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExamplePlugin

type ExamplePlugin struct {
}

ExamplePlugin is an example implementation of the Plugin interface.

func (*ExamplePlugin) Handle

func (p *ExamplePlugin) Handle(ctx context.Context, msg *apiv1.HostMessage)

func (*ExamplePlugin) Name

func (p *ExamplePlugin) Name() string

type Plugin

type Plugin interface {
	Name() string
	Handle(ctx context.Context, msg *apiv1.HostMessage)
}

Plugin is the interface that all plugins must implement.

func LoadPlugins

func LoadPlugins(logger *zap.Logger, cfg *config.Config) ([]Plugin, error)

LoadPlugins loads plugins based on the configuration

type WGPlugin

type WGPlugin struct {
	// contains filtered or unexported fields
}

WGPlugin is a plugin that executes a shell command when a message is received.

func NewWGPlugin

func NewWGPlugin(logger *zap.Logger, c *config.WgSpec) *WGPlugin

NewWGPlugin creates a new WGPlugin.

func (*WGPlugin) Handle

func (p *WGPlugin) Handle(ctx context.Context, msg *apiv1.HostMessage)

Handle executes the shell command when a message is received.

func (*WGPlugin) Name

func (p *WGPlugin) Name() string

Name returns the name of the plugin.

func (*WGPlugin) SetPeerEndpoint

func (p *WGPlugin) SetPeerEndpoint(iface string, peer string, endpoint string) error

Jump to

Keyboard shortcuts

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