vlplugin

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = "1.0.0"

APIVersion version of current API

Variables

View Source
var (
	// ErrInvalidArgs invalid arguments
	ErrInvalidArgs = errors.New("plugin: invalid arguments")
)

Functions

func Version added in v0.2.0

func Version() string

Types

type Descriptor

type Descriptor struct {
	V string
	N string
	D string
	T string
}

Descriptor describes plugin

func (*Descriptor) Desc

func (b *Descriptor) Desc() string

Desc of plugin

func (*Descriptor) Name

func (b *Descriptor) Name() string

Name of plugin

func (*Descriptor) Type

func (b *Descriptor) Type() string

Type of plugin

func (*Descriptor) Version

func (b *Descriptor) Version() (string, string)

Version of plugin. Version format format major.minor.patch returns API version plugin is built with

plugin version

type HTTP

type HTTP interface {
	GetHTTPServer(port string) HTTPHandler
}

HTTP ...

type HTTPHandler

type HTTPHandler interface {
	Mux() *http.ServeMux
	Addr() string
}

HTTPHandler provided by VolantMQ server

type Health

type Health interface {
	GetHealth() healthcheck.Checks
}

Health ...

type Info

type Info interface {
	// Version in format major.minor.patch
	Version() (string, string)
	// Name plugin name
	Name() string
	// Desc plugin description
	Desc() string
	// Type plugin type
	Type() string
}

Info return plugin information

type Messaging

type Messaging interface {
	GetSubscriber(id string) (vlsubscriber.IFace, error)
}

nolint: golint

type Must

type Must interface {
	Shutdown() error
}

nolint: golint

type Plugin

type Plugin interface {
	// Init initialize plugin
	// might accepts interface which specifies config
	// return interface to plugin entry
	Load(interface{}, *SysParams) (interface{}, error)

	// Info plugin information
	Info() Info
}

Plugin entry to plugin

type SysParams

type SysParams struct {
	Messaging
	HTTP
	Health
	Log           *zap.SugaredLogger
	SignalFailure func(name, msg string)
}

SysParams system-wide config passed to plugin

Directories

Path Synopsis
mem

Jump to

Keyboard shortcuts

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