Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreatorFn ¶
type CreatorFn func(pluginCtx PluginContext, options v1.VisitorPluginOptions) (Plugin, error)
type Plugin ¶
func Create ¶
func Create(pluginName string, pluginCtx PluginContext, options v1.VisitorPluginOptions) (p Plugin, err error)
func NewVirtualNetPlugin ¶
func NewVirtualNetPlugin(pluginCtx PluginContext, options v1.VisitorPluginOptions) (Plugin, error)
type PluginContext ¶
type PluginContext struct {
// Name is the unique identifier for this visitor, used for logging and routing.
Name string
// Ctx manages the plugin's lifecycle and carries the logger for structured logging.
Ctx context.Context
// VnetController manages TUN device routing. May be nil if virtual networking is disabled.
VnetController *vnet.Controller
// SendConnToVisitor sends a connection to the visitor's internal processing queue.
// Does not return error; failures are handled by closing the connection.
SendConnToVisitor func(net.Conn)
}
PluginContext provides the necessary context and callbacks for visitor plugins.
type VirtualNetPlugin ¶
type VirtualNetPlugin struct {
// contains filtered or unexported fields
}
func (*VirtualNetPlugin) Close ¶
func (p *VirtualNetPlugin) Close() error
Close initiates the plugin shutdown.
func (*VirtualNetPlugin) Name ¶
func (p *VirtualNetPlugin) Name() string
func (*VirtualNetPlugin) Start ¶
func (p *VirtualNetPlugin) Start()
Click to show internal directories.
Click to hide internal directories.