plugin

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "plugin"

Variables

This section is empty.

Functions

func Middleware

func Middleware(name string, middleware types.Middleware)

func Register

func Register(pg Plugin)

Types

type Base

type Base struct {
	Name         string
	Descriptor   string
	Url          string
	Docs         interface{}
	OnHealth     types.Healthy
	OnMiddleware types.Middleware
	OnInit       func(p Process)
	OnCommands   func() *types.Command
	OnFlags      func() types.Flags
	OnWatch      types.Watcher
	OnVars       func(v types.Vars)
	// contains filtered or unexported fields
}

func (*Base) AfterStart

func (p *Base) AfterStart(fn func())

func (*Base) AfterStarts

func (p *Base) AfterStarts() []func()

func (*Base) AfterStop

func (p *Base) AfterStop(fn func())

func (*Base) AfterStops

func (p *Base) AfterStops() []func()

func (*Base) BeforeStart

func (p *Base) BeforeStart(fn func())

func (*Base) BeforeStarts

func (p *Base) BeforeStarts() []func()

func (*Base) BeforeStop

func (p *Base) BeforeStop(fn func())

func (*Base) BeforeStops

func (p *Base) BeforeStops() []func()

func (*Base) Commands

func (p *Base) Commands() *cli.Command

func (*Base) Flags

func (p *Base) Flags() types.Flags

func (*Base) Health

func (p *Base) Health() types.Healthy

func (*Base) Init

func (p *Base) Init() error

func (*Base) MarshalJSON

func (p *Base) MarshalJSON() ([]byte, error)

func (*Base) Middleware

func (p *Base) Middleware() types.Middleware

func (*Base) String

func (p *Base) String() string

func (*Base) UniqueName

func (p *Base) UniqueName() string

func (*Base) Vars

func (p *Base) Vars(f types.Vars) error

func (*Base) Watch

func (p *Base) Watch() types.Watcher

type Plugin

type Plugin interface {
	String() string
	UniqueName() string
	Flags() types.Flags
	Commands() *types.Command
	Init() error
	Watch() types.Watcher
	Vars(types.Vars) error
	Health() types.Healthy
	Middleware() types.Middleware
	BeforeStarts() []func()
	AfterStarts() []func()
	BeforeStops() []func()
	AfterStops() []func()
}

func All

func All() []Plugin

func Get

func Get(name string) Plugin

type Process

type Process interface {
	BeforeStart(fn func())
	AfterStart(fn func())
	BeforeStop(fn func())
	AfterStop(fn func())
}

Jump to

Keyboard shortcuts

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