Documentation ¶
Index ¶
- func ByType[T any](plugs Plugins) []T
- func Stderr(plugs ...Plugin) io.Writer
- func Stdout(plugs ...Plugin) io.Writer
- type AvailabilityChecker
- type FSSetable
- type FSable
- type Feeder
- type FeederFn
- type Findable
- type FinderFn
- type IO
- type IOSetable
- type IOable
- type Needer
- type Plugin
- type Plugins
- func (plugs Plugins) Available(root string) Plugins
- func (plugs Plugins) Find(fn FinderFn) (Plugins, error)
- func (plugs Plugins) Len() int
- func (plugs Plugins) Less(i int, j int) bool
- func (plugs Plugins) PluginFeeder() FeederFn
- func (plugs Plugins) PluginName() string
- func (plugs Plugins) ScopedPlugins() Plugins
- func (plugs Plugins) SetFileSystem(fs fs.FS) error
- func (plugs Plugins) SetStdio(io IO) error
- func (plugs Plugins) Swap(i int, j int)
- func (plugs Plugins) WithPlugins(fn FeederFn) error
- type Scoper
- type Stderrer
- type Stdiner
- type Stdioer
- type Stdouter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AvailabilityChecker ¶
AvailabilityChecker can be implemented to check if a plugin is available to be used at the given root.
type FeederFn ¶
type FeederFn func() Plugins
FeederFn is a function that is used to feed plugins into a Needer implementation.
type Findable ¶
Findable can be implemented to find plugins
func Background ¶
Background finder that will search for a plugin based on the plugin's name.
type FinderFn ¶
FinderFn is a function that can be used to find plugins. It implements the Finder interface.
type Needer ¶
Needer can be implemented to receive a Feeder function that can be used to gain access to other plugins in the system.
type Plugin ¶
type Plugin interface {
PluginName() string
}
Plugin is the most basic interface a plugin can implement.
type Plugins ¶
type Plugins []Plugin
Plugins is a slice of type `Plugin` that provides additional useful functionality.
func (Plugins) Available ¶
Available will return plugins that are available to be used at the given root. By default, all plugins are available. The AvailabilityChecker interface can be implemented to give the plugin the ability to check if it is available.
func (Plugins) Less ¶
Less reports whether the element with index i should sort before the element with index j.
func (Plugins) PluginFeeder ¶
func (Plugins) PluginName ¶
func (Plugins) ScopedPlugins ¶
ScopedPlugins implements Scoper, return itself.
func (Plugins) SetFileSystem ¶
SetFS for those plugins that implement FSSetable.
func (Plugins) WithPlugins ¶
WithPlugins will call any Needer plugins with the Feeder function.