daemon

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	Support
	// contains filtered or unexported fields
}

Metrics holds metrics counters

func NewMetrics

func NewMetrics(ctx context.Context, cfg config.Configuration) Metrics

NewMetrics returns blank metrics holder

func (Metrics) MessageEgress

func (metrics Metrics) MessageEgress(num int64)

MessageEgress increment number of outcomming messages

func (Metrics) MessageIngress

func (metrics Metrics) MessageIngress(num int64)

MessageIngress increment number of incomming messages

func (Metrics) Start

func (metrics Metrics) Start()

Start handles everything needed to start metrics daemon

type Relay

type Relay struct {
	Support
	// contains filtered or unexported fields
}

Relay fascade

func NewRelay

func NewRelay(ctx context.Context, cfg config.Configuration, metrics *Metrics) Relay

NewRelay returns new instance of Relay

func (Relay) Start

func (r Relay) Start()

Start handles everything needed to start relay

type Snapshot

type Snapshot struct {
	MessageEgress  int64 `json:"messageEgress"`
	MessageIngress int64 `json:"messageIngress"`
}

Snapshot holds metrics snapshot status

func NewSnapshot

func NewSnapshot(entity Metrics) Snapshot

NewSnapshot returns metrics snapshot

type Support

type Support struct {
	IsReady chan interface{}
	// contains filtered or unexported fields
}

Support provides support for graceful shutdown

func NewDaemonSupport

func NewDaemonSupport(parentCtx context.Context) Support

NewDaemonSupport constructor

func (Support) Done

func (s Support) Done() <-chan struct{}

Done cancel channel

func (Support) MarkDone

func (s Support) MarkDone()

MarkDone signals daemon is finished

func (Support) MarkReady

func (s Support) MarkReady()

MarkReady signals daemon is ready

func (Support) Start

func (s Support) Start()

Start daemon and wait for it to be ready

func (Support) Stop

func (s Support) Stop()

Stop daemon and wait for graceful shutdown

Jump to

Keyboard shortcuts

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