adapter

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package adapter is the implementation of LogDNA 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
	// contains filtered or unexported fields
}

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 Configuration

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

Configuration is Configuration Struct for LogDNA 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"`
	Line      string `json:"line"`
	File      string `json:"file"`
}

Line structure for the queue of Adapter:

type Message

type Message struct {
	Message   string        `json:"message"`
	Container ContainerInfo `json:"container"`
	Level     string        `json:"level"`
	Hostname  string        `json:"hostname"`
	Tags      string        `json:"tags"`
}

Message structure:

Jump to

Keyboard shortcuts

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