plugins

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FrontmanPlugin

type FrontmanPlugin interface {
	// Name returns the name of the plugin.
	Name() string

	// PreRequest is called before sending the request to the target service.
	// The method takes in the original request, a ServiceRegistry, and a Config.
	// An error is returned if the plugin encounters any issues.
	PreRequest(*http.Request, service.ServiceRegistry, *config.Config) PluginError

	// PostResponse is called after receiving the response from the target service.
	// The method takes in the response, a ServiceRegistry, and a Config.
	// An error is returned if the plugin encounters any issues.
	PostResponse(*http.Response, service.ServiceRegistry, *config.Config) PluginError

	// Close is called when the plugin is being shut down.
	// An error is returned if the plugin encounters any issues.
	Close() PluginError
}

FrontmanPlugin is an interface for creating plugins for Frontman.

func LoadPlugins

func LoadPlugins(pluginPaths []string) ([]FrontmanPlugin, error)

LoadPlugins loads the plugins in the specified order and returns a slice of FrontmanPlugin instances.

type PluginError

type PluginError interface {
	StatusCode() int
	Error() string
}

Jump to

Keyboard shortcuts

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