adapter

package
v0.0.0-...-a373227 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package adapter is the implementation of Newrelic LogSpout Adapter

Package adapter is the implementation of LogDNA LogSpout Adapter

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	Config     Configuration
	HTTPClient heimdall.Client
	Logger     *log.Logger
	Queue      chan Line
}

Adapter structure:

func New

func New(config Configuration) *Adapter

New method of Adapter:

func (*Adapter) Stream

func (adapter *Adapter) Stream(logstream chan *router.Message)

Stream method is for streaming the messages:

type Attributes

type Attributes struct {
	Container ContainerInfo `json:"container"`
	Source    string        `json:"source"`
	Hostname  string        `json:"hostname"`
}

Message structure:

type Configuration

type Configuration struct {
	BackoffInterval   time.Duration
	FlushInterval     time.Duration
	Hostname          string
	HTTPTimeout       time.Duration
	JitterInterval    time.Duration
	NewrelicKey       string
	NewrelicURL       string
	MaxBufferSize     uint64
	RequestRetryCount uint64
	Tags              string
}

Configuration is Configuration Struct for Newrelic Adapter:

type ContainerConfig

type ContainerConfig struct {
	Image    string            `json:"image"`
	Hostname string            `json:"hostname"`
	Labels   map[string]string `json:"labels"`
}

ContainerConfig structure for the Config of ContainerInfo:

type ContainerInfo

type ContainerInfo struct {
	Name   string          `json:"name"`
	ID     string          `json:"id"`
	Config ContainerConfig `json:"config"`
}

ContainerInfo structure for the Container of Message:

type Line

type Line struct {
	Timestamp  int64      `json:"timestamp"`
	Message    string     `json:"message"`
	Attributes Attributes `json:"attributes"`
}

Line structure for the queue of Adapter:

Jump to

Keyboard shortcuts

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