plugins

package
v0.0.0-...-d0327f8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterEndpoint

func RegisterEndpoint(request REQUEST, pattern string, handler func(echo.Context) error)

RegisterEndpoint points an endpoint to a specific plugin while keeping

func RegisterPlugin

func RegisterPlugin(name string, p Plugin)

RegisterPlugin registers plugins. Should be called using init function in plugin package

func SetupPlugins

func SetupPlugins(m *echo.Echo, d *sql.DB, names []string)

SetupPlugins activates plugins and loads endpoints

Types

type CoreDomain

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

CoreDomain is the struct used to pass Domain data between plugins and the plugin package

type CoreHost

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

CoreHost is the struct used to pass host data between plugins and the plugin package

type CoreNetwork

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

CoreNetwork is the struct used to pass Network data between plugins and the plugin package

type CoreOption

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

CoreOption is the struct used to pass Network data between plugins and the plugin package

type DomainHandlerPlugin

type DomainHandlerPlugin interface {
	Plugin
	DomainHandler(CoreDomain, CoreOption) (CoreDomain, CoreOption)
}

DomainHandlerPlugin is an interface that extends the Plugin interface, in order to modify Domains

type HostHandlerPlugin

type HostHandlerPlugin interface {
	Plugin
	HostHandler(CoreHost, CoreOption) (CoreHost, CoreOption)
}

HostHandlerPlugin is an interface that extends the Plugin interface, in order to modify Hosts

type NetworkHandlerPlugin

type NetworkHandlerPlugin interface {
	Plugin
	NetworkHandler(CoreNetwork, CoreOption) (CoreNetwork, CoreOption)
}

NetworkHandlerPlugin is an interface that extends the Plugin interface, in order to modify Networks

type Plugin

type Plugin interface {
	Activate()    //should register endpoints and add database tables etc
	Active() bool //should check if plugin has already been activated
}

Plugin is an interface defining all plugin exported functions

type REQUEST

type REQUEST int

REQUEST - endpoint request type

const (
	//GET - get endpoint behavior
	GET REQUEST = 0
	//PUT - put endpoint behavior
	PUT REQUEST = 1
	//POST - post endpoint behavior
	POST REQUEST = 2
	//DELETE - delete endpoint behavior
	DELETE REQUEST = 3
)

type UniversalHandlerPlugin

type UniversalHandlerPlugin interface {
	Plugin
	UniversalHandler(func(echo.Context) error) func(echo.Context) error
}

UniversalHandlerPlugin is an interface that extends the Plugin interface, for if a plugin needs to be called on all endpoints

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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