listener

package
v1.5.12 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VersionUnsupported is here for use in error returns etc.
	VersionUnsupported = Version("unsupported")

	// Version1_0 is the API 1.0 version of the protocol (see above).
	Version1_0 = Version("1.0")

	// Version1_2 is the API 1.0 version of the protocol (see above).
	Version1_2 = Version("1.2")
)

Variables

This section is empty.

Functions

func IsDisconnected

func IsDisconnected(err error) bool

IsDisconnected is a convenience function that wraps the absurdly long set of checks for a disconnect.

Types

type MonitorListener

type MonitorListener interface {
	// Enqueue adds this payload to the send queue. Any errors should be logged
	// and handled appropriately.
	Enqueue(pl *payload.Payload)

	// Version returns the API version of this listener
	Version() Version
}

MonitorListener is a generic consumer of monitor events. Implementers are expected to handle errors as needed, including exiting.

type Version

type Version string

Version is the version of a node-monitor listener client. There are two API versions:

  • 1.0 which encodes the gob type information with each payload sent, and adds a meta object before it.
  • 1.2 which maintains a gob session per listener, thus only encoding the type information on the first payload sent. It does NOT prepend the a meta object.

Jump to

Keyboard shortcuts

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