status

package
v0.0.0-...-c036721 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(sourcesToTrack []*SourceToTrack)

Initialize instanciates builder

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder builds the status

func NewBuilder

func NewBuilder(sourcesToTrack []*SourceToTrack) *Builder

NewBuilder returns a new Builder

func (*Builder) Build

func (b *Builder) Build() Status

Build returns the status

type Integration

type Integration struct {
	Name    string   `json:"name"`
	Sources []Source `json:"sources"`
}

Integration provides some information about a logs integration

type Source

type Source struct {
	Type   string `json:"type"`
	Status string `json:"status"`
}

Source provides some information about a logs source

type SourceToTrack

type SourceToTrack struct {
	// contains filtered or unexported fields
}

SourceToTrack represents a source tracker for a given integration space

func NewSourceToTrack

func NewSourceToTrack(integrationName string, tracker *Tracker) *SourceToTrack

NewSourceToTrack returns a new SourceToTrack

type Status

type Status struct {
	IsRunning    bool          `json:"is_running"`
	Integrations []Integration `json:"integrations"`
}

Status provides some information about logs-agent

func Get

func Get() Status

Get returns the status of logs-agent computed on the fly

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

Tracker Tracks errors and success operations for a given source it's designed to be thread safe

func NewTracker

func NewTracker(sourceType string) *Tracker

NewTracker returns a new Tracker

func (*Tracker) GetSource

func (t *Tracker) GetSource() Source

GetSource returns the source computed from sourceType and status

func (*Tracker) TrackError

func (t *Tracker) TrackError(err error)

TrackError formats the error and keeps it in status

func (*Tracker) TrackSuccess

func (t *Tracker) TrackSuccess()

TrackSuccess formats the success operation and keeps it in status

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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