plugins

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Location is the folder to put the plugin into.
	Location string
}

Config has the configuration options for the plugins.

type Dependencies

type Dependencies struct {
	Logger zerolog.Logger
	Store  providers.CommandStorer
	Tar    providers.Tar
}

Dependencies defines the dependencies for the plugin provider.

type Plugins

type Plugins struct {
	Config
	Dependencies
}

Plugins is a plugin handler which uses basic Go plugins and the plugins package.

func NewPluginsProvider

func NewPluginsProvider(cfg Config, deps Dependencies) *Plugins

NewPluginsProvider creates a new Go based plugin provider. Starts the folder watcher.

func (*Plugins) Copy

func (p *Plugins) Copy(src, dst string) error

Copy the src file to dst. Any existing file will be overwritten and will not

func (*Plugins) Create

func (p *Plugins) Create(ctx context.Context, file string) (string, string, error)

Create will handle creating a plugin, including un-taring and copying the plugin into the right location. It returns the hash of the command. Creating the command is not its responsibility.

func (*Plugins) Delete

func (p *Plugins) Delete(ctx context.Context, name string) error

Delete will handle deleting a plugin from permanent storage.

Jump to

Keyboard shortcuts

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