schema

package
v0.0.0-...-7f3e7ba Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Monitor     Monitor
	Persistor   Persistor
	App         ExitSignalApp
	Username    string
	UserVersion string
	AppID       string
	MacHash     string
	Encoding    Encoding
}

Config provides parameters needed by a Converter.

type Converter

type Converter struct {
	Config
	// contains filtered or unexported fields
}

Converter converts a stream of agent.Message to a stream of broker.Message.

func NewConverter

func NewConverter(cfg Config, in ...agent.MessageSource) Converter

NewConverter returns a converter for the given input streams that uses the given persistor and app.

func (Converter) Output

func (c Converter) Output() <-chan broker.Message

Output returns the converter's output stream.

type Encoding

type Encoding int

Encoding represents the serialization encoding.

const (
	MsgPack Encoding = iota
	JSON
)

These are the available encodings.

type ExitSignalApp

type ExitSignalApp interface {
	AgentVersion() string
	CheckSum() string
	ExitStatus() int
	Signal() string
}

ExitSignalApp is an App that has a signal and exit status.

type MessageSource

type MessageSource interface {
	Output() <-chan agent.Message
}

MessageSource is a source of agent messages.

type Monitor

type Monitor interface {
	GetMetrics() device.Metrics
	Close()
}

Monitor provides system metrics.

type Persistor

type Persistor interface {
	CreateMessage(*broker.Message) error
}

Persistor provides a persistor interface.

Jump to

Keyboard shortcuts

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