pluginregistry

package
v0.0.0-...-e9f0680 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssertPlugin

type AssertPlugin interface {
	Plugin
	// GetTypeName the plugin type
	GetTypeName() string

	// Assert response and other assert commands
	Assert(*mbcase.Response, []mbcase.CommonAssert) error
}

type BasicRegistry

type BasicRegistry struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*BasicRegistry) AssertPlugins

func (b *BasicRegistry) AssertPlugins() []AssertPlugin

AssertPlugins implements Registry

func (*BasicRegistry) EnvPlugins

func (b *BasicRegistry) EnvPlugins() []EnvPlugin

EnvPlugins implements Registry

func (*BasicRegistry) RegisterAssertPlugin

func (b *BasicRegistry) RegisterAssertPlugin(plugins ...AssertPlugin)

RegisterAssertPlugin implements Registry

func (*BasicRegistry) RegisterEnvPlugin

func (b *BasicRegistry) RegisterEnvPlugin(plugins ...EnvPlugin)

RegisterEnvPlugin implements Registry

type Config

type Config struct{}

Config defines the config structure

func NewConfig

func NewConfig() *Config

NewConfig is used to init config with default values

func (*Config) RegisterFlagsWithPrefix

func (c *Config) RegisterFlagsWithPrefix(prefix string, f *pflag.FlagSet)

RegisterFlagsWithPrefix is used to register flags

func (*Config) Validate

func (c *Config) Validate() error

Validate is used to validate config and returns error on failure

type EnvPlugin

type EnvPlugin interface {
	Plugin
	// GetTypeName the plugin type
	GetTypeName() string
	// Run setup run
	Run(commands []string) error
}

EnvPlugin Provide environmental support at runtime. (mysql, redis, ....)

type Plugin

type Plugin interface {
	Name() string
}

Plugin defines the most basic requirements for plug-ins All plugins should implement this interface

type Registry

type Registry interface {
	EnvPlugins() []EnvPlugin
	RegisterEnvPlugin(...EnvPlugin)

	AssertPlugins() []AssertPlugin
	RegisterAssertPlugin(...AssertPlugin)
}

func New

func New(logger logger.Logger, cfg *Config) (Registry, error)

Directories

Path Synopsis
assertprovid
envprovid

Jump to

Keyboard shortcuts

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