heartbeat

package
v0.0.0-...-c8b15d8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Protocol     *heartbeatProtocol
	MiniProtocol = protocols.NewMiniProtocol(Protocol)
)

Functions

func RegisterServerHandler

func RegisterServerHandler(server *protocols.Server, handler HeartbeatServerHandler) error

Types

type Client

type Client struct {
	protocols.Client
}

func NewClient

func NewClient(client protocols.Client) (*Client, error)

func NewClientFor

func NewClientFor(server_addr string) (*Client, error)

func (*Client) ConfigureHeartbeat

func (client *Client) ConfigureHeartbeat(receiver *protocols.Server, token int64, timeout time.Duration) error

type ConfigureHeartbeatPacket

type ConfigureHeartbeatPacket struct {
	Token        int64
	TargetServer string
	Timeout      time.Duration
}

type HeartbeatFaultDetector

type HeartbeatFaultDetector struct {
	*protocols.FaultDetectorBase
	// contains filtered or unexported fields
}

func (*HeartbeatFaultDetector) Check

func (detector *HeartbeatFaultDetector) Check()

func (*HeartbeatFaultDetector) Close

func (detector *HeartbeatFaultDetector) Close() error

func (*HeartbeatFaultDetector) IsStopped

func (detector *HeartbeatFaultDetector) IsStopped() bool

func (*HeartbeatFaultDetector) Start

func (detector *HeartbeatFaultDetector) Start()

func (*HeartbeatFaultDetector) String

func (detector *HeartbeatFaultDetector) String() string

type HeartbeatPacket

type HeartbeatPacket struct {
	Token    int64
	Source   string
	TimeSent time.Time
	Seq      uint64
}

type HeartbeatServer

type HeartbeatServer struct {
	*protocols.Server
	// contains filtered or unexported fields
}

func NewHeartbeatServer

func NewHeartbeatServer(local_addr string) (*HeartbeatServer, error)

func (*HeartbeatServer) HeartbeatReceived

func (server *HeartbeatServer) HeartbeatReceived(beat *HeartbeatPacket)

func (*HeartbeatServer) ObserveServer

func (server *HeartbeatServer) ObserveServer(endpoint string, heartbeatFrequency time.Duration, acceptableTimeout time.Duration) (protocols.FaultDetector, error)

func (*HeartbeatServer) Start

func (server *HeartbeatServer) Start(wg *sync.WaitGroup) golib.StopChan

type HeartbeatServerHandler

type HeartbeatServerHandler interface {
	HeartbeatReceived(beat *HeartbeatPacket)
}

Jump to

Keyboard shortcuts

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