termination

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package termination defines the Termination stage of the plugin loader pipeline.

The Termination stage must implement the Terminator interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendProcessTerminator

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

BackendProcessTerminator implements a TerminateFunc for stopping a backend plugin process.

It uses the process.Manager to stop the backend plugin process.

func (*BackendProcessTerminator) Terminate

Terminate stops a backend plugin process.

type Deregister

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

Deregister implements a TerminateFunc for removing a plugin from the plugin registry.

func (*Deregister) Deregister

func (d *Deregister) Deregister(ctx context.Context, p *plugins.Plugin) error

Deregister removes a plugin from the plugin registry.

type Opts

type Opts struct {
	TerminateFuncs []TerminateFunc
}

type Terminate

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

func New

func New(cfg *config.Cfg, opts Opts) (*Terminate, error)

New returns a new Termination stage.

func (*Terminate) Terminate

func (t *Terminate) Terminate(ctx context.Context, p *plugins.Plugin) (*plugins.Plugin, error)

Terminate will execute the Terminate steps of the Termination stage.

type TerminateFunc

type TerminateFunc func(ctx context.Context, p *plugins.Plugin) error

TerminateFunc is the function used for the Terminate step of the Termination stage.

func BackendProcessTerminatorStep

func BackendProcessTerminatorStep(processManager process.Manager) TerminateFunc

BackendProcessTerminatorStep returns a new TerminateFunc for stopping a backend plugin process.

func DeregisterStep

func DeregisterStep(pluginRegistry registry.Service) TerminateFunc

DeregisterStep returns a new TerminateFunc for removing a plugin from the plugin registry.

type Terminator

type Terminator interface {
	Terminate(ctx context.Context, p *plugins.Plugin) (*plugins.Plugin, error)
}

Terminator is responsible for the Termination stage of the plugin loader pipeline.

Jump to

Keyboard shortcuts

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