Version: v0.0.0-...-7f3e7ba Latest Latest

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

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



Package agent provides access to an Auklet agent.



This section is empty.


This section is empty.


This section is empty.


type DataPointServer

type DataPointServer struct {
	// contains filtered or unexported fields

DataPointServer reads a stream of data point JSON messages.

func NewDataPointServer

func NewDataPointServer(in io.Reader) *DataPointServer

NewDataPointServer returns a new DataPointServer.

func (*DataPointServer) Output

func (s *DataPointServer) Output() <-chan Message

Output returns s's output stream.

type Merger

type Merger struct {
	// contains filtered or unexported fields

Merger is a MessageSource that merges multiple other MessageSources into one stream.

func Merge

func Merge(src ...MessageSource) Merger

Merge returns a Merger that merges the streams of each element in src.

func (Merger) Output

func (m Merger) Output() <-chan Message

Output returns m's output channel. It closes when all input streams have closed.

type Message

type Message struct {
	Type string          `json:"type"`
	Data json.RawMessage `json:"data"`

Message represents messages that can be received by a Server, and thus, would be sent by an agent.

type MessageSource

type MessageSource interface {
	Output() <-chan Message

MessageSource is a source of messages.

type PeriodicRequester

type PeriodicRequester struct {
	// contains filtered or unexported fields

PeriodicRequester periodically sends emission requests over a connection.

func NewPeriodicRequester

func NewPeriodicRequester(conn io.Writer, done <-chan struct{}, conf <-chan int) PeriodicRequester

NewPeriodicRequester creates a PeriodicRequester that sends requests over conn. When done closes, the requester closes its output and terminates.

func (PeriodicRequester) Output

func (r PeriodicRequester) Output() <-chan broker.Message

Output returns r's output channel, which might generate an error message.

type Server

type Server struct {

	// Done closes when the Server gets EOF.
	Done chan struct{}
	// contains filtered or unexported fields

Server provides a connection server for an Auklet agent.

func NewServer

func NewServer(in io.Reader, dec *json.Decoder) *Server

NewServer returns a new Server that reads from in. If dec is not nil, it is used directly.

func (*Server) Output

func (s *Server) Output() <-chan Message

Output returns s's output stream.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL