plugins

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const NetworkCheckError = "Error"

NetworkCheckError is a status for when the NetworkCheck Plugin has had an error making an out going connection indicating it may be offline

View Source
const NetworkCheckSuccess = "Success"

NetworkCheckSuccess is a status for when the NetworkCheck Plugin has had a successful message from a peer, indicating it is online right now

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin interface {
	Start()
	Shutdown()
}

Plugin is the interface for a plugin

func Get

func Get(id PluginID, bus event.Manager, acn connectivity.ACN, onion string) (Plugin, error)

Get is a plugin factory for the requested plugin

func NewConnectionRetry added in v0.3.1

func NewConnectionRetry(bus event.Manager, onion string) Plugin

NewConnectionRetry returns a Plugin that when started will retry connecting to contacts with a backoff timing

func NewNetworkCheck added in v0.3.3

func NewNetworkCheck(bus event.Manager, acn connectivity.ACN) Plugin

NewNetworkCheck returns a Plugin that when started will attempt various network tests

type PluginID

type PluginID int

PluginID is used as an ID for signaling plugin activities

const (
	CONNECTIONRETRY PluginID = iota
	NETWORKCHECK
)

These are the plugin IDs for the supplied plugins

type TimeoutPolicy added in v0.4.0

type TimeoutPolicy time.Duration

TimeoutPolicy is an interface for enforcing common timeout patterns

func (*TimeoutPolicy) ExecuteAction added in v0.4.0

func (tp *TimeoutPolicy) ExecuteAction(action func() error) error

ExecuteAction runs a function and returns an error if it hasn't returned by the time specified by TimeoutPolicy

Jump to

Keyboard shortcuts

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