message

package
v0.0.0-...-e3fb0e6 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: Apache-2.0 Imports: 1 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMessage

func NewMessage(content []byte) *message

NewMessage returns a new message

Types

type ContainerMessage

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

ContainerMessage is a message coming from a container Source

func NewContainerMessage

func NewContainerMessage(content []byte) *ContainerMessage

func (ContainerMessage) Content

func (m ContainerMessage) Content() []byte

Content returns the content the message, the actual log line

func (ContainerMessage) GetOrigin

func (m ContainerMessage) GetOrigin() *MessageOrigin

GetOrigin returns the Origin from which the message comes

func (ContainerMessage) GetSeverity

func (m ContainerMessage) GetSeverity() []byte

GetSeverity returns the severity of the message when set

func (ContainerMessage) GetTagsPayload

func (m ContainerMessage) GetTagsPayload() []byte

GetSeverity returns the tags and sources of the message It will default on the LogSource tags payload, but can be overriden in the message itself with tagsPayload

func (ContainerMessage) GetTimestamp

func (m ContainerMessage) GetTimestamp() string

GetTimestamp returns the timestamp of the message, or "" if no timestamp is relevant

func (ContainerMessage) SetContent

func (m ContainerMessage) SetContent(content []byte)

SetContent updates the content the message

func (ContainerMessage) SetOrigin

func (m ContainerMessage) SetOrigin(Origin *MessageOrigin)

SetOrigin sets the integration from which the message comes

func (ContainerMessage) SetSeverity

func (m ContainerMessage) SetSeverity(severity []byte)

SetSeverity sets the severity of the message

func (ContainerMessage) SetTagsPayload

func (m ContainerMessage) SetTagsPayload(tagsPayload []byte)

SetSeverity sets the tags and sources of the message

type FileMessage

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

FileMessage is a message coming from a File

func NewFileMessage

func NewFileMessage(content []byte) *FileMessage

func (FileMessage) Content

func (m FileMessage) Content() []byte

Content returns the content the message, the actual log line

func (FileMessage) GetOrigin

func (m FileMessage) GetOrigin() *MessageOrigin

GetOrigin returns the Origin from which the message comes

func (FileMessage) GetSeverity

func (m FileMessage) GetSeverity() []byte

GetSeverity returns the severity of the message when set

func (FileMessage) GetTagsPayload

func (m FileMessage) GetTagsPayload() []byte

GetSeverity returns the tags and sources of the message It will default on the LogSource tags payload, but can be overriden in the message itself with tagsPayload

func (FileMessage) GetTimestamp

func (m FileMessage) GetTimestamp() string

GetTimestamp returns the timestamp of the message, or "" if no timestamp is relevant

func (FileMessage) SetContent

func (m FileMessage) SetContent(content []byte)

SetContent updates the content the message

func (FileMessage) SetOrigin

func (m FileMessage) SetOrigin(Origin *MessageOrigin)

SetOrigin sets the integration from which the message comes

func (FileMessage) SetSeverity

func (m FileMessage) SetSeverity(severity []byte)

SetSeverity sets the severity of the message

func (FileMessage) SetTagsPayload

func (m FileMessage) SetTagsPayload(tagsPayload []byte)

SetSeverity sets the tags and sources of the message

type Message

type Message interface {
	Content() []byte
	SetContent([]byte)
	GetOrigin() *MessageOrigin
	SetOrigin(*MessageOrigin)
	GetTimestamp() string // No need for SetTimestamp as we use MessageOrigin under the hood
	GetSeverity() []byte
	SetSeverity([]byte)
	GetTagsPayload() []byte
	SetTagsPayload([]byte)
}

Message represents a log line sent to datadog, with its metadata

type MessageOrigin

type MessageOrigin struct {
	Identifier string
	LogSource  *config.IntegrationConfigLogSource
	Offset     int64
	Timestamp  string
}

MessageOrigin represents the Origin of a message

func NewOrigin

func NewOrigin() *MessageOrigin

NewFileOrigin returns a new MessageOrigin

type NetworkMessage

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

FileMessage is a message coming from a network Source

func NewNetworkMessage

func NewNetworkMessage(content []byte) *NetworkMessage

func (NetworkMessage) Content

func (m NetworkMessage) Content() []byte

Content returns the content the message, the actual log line

func (NetworkMessage) GetOrigin

func (m NetworkMessage) GetOrigin() *MessageOrigin

GetOrigin returns the Origin from which the message comes

func (NetworkMessage) GetSeverity

func (m NetworkMessage) GetSeverity() []byte

GetSeverity returns the severity of the message when set

func (NetworkMessage) GetTagsPayload

func (m NetworkMessage) GetTagsPayload() []byte

GetSeverity returns the tags and sources of the message It will default on the LogSource tags payload, but can be overriden in the message itself with tagsPayload

func (NetworkMessage) GetTimestamp

func (m NetworkMessage) GetTimestamp() string

GetTimestamp returns the timestamp of the message, or "" if no timestamp is relevant

func (NetworkMessage) SetContent

func (m NetworkMessage) SetContent(content []byte)

SetContent updates the content the message

func (NetworkMessage) SetOrigin

func (m NetworkMessage) SetOrigin(Origin *MessageOrigin)

SetOrigin sets the integration from which the message comes

func (NetworkMessage) SetSeverity

func (m NetworkMessage) SetSeverity(severity []byte)

SetSeverity sets the severity of the message

func (NetworkMessage) SetTagsPayload

func (m NetworkMessage) SetTagsPayload(tagsPayload []byte)

SetSeverity sets the tags and sources of the message

type StopMessage

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

StopMessage is used to let a component stop gracefully

func NewStopMessage

func NewStopMessage() *StopMessage

func (StopMessage) Content

func (m StopMessage) Content() []byte

Content returns the content the message, the actual log line

func (StopMessage) GetOrigin

func (m StopMessage) GetOrigin() *MessageOrigin

GetOrigin returns the Origin from which the message comes

func (StopMessage) GetSeverity

func (m StopMessage) GetSeverity() []byte

GetSeverity returns the severity of the message when set

func (StopMessage) GetTagsPayload

func (m StopMessage) GetTagsPayload() []byte

GetSeverity returns the tags and sources of the message It will default on the LogSource tags payload, but can be overriden in the message itself with tagsPayload

func (StopMessage) GetTimestamp

func (m StopMessage) GetTimestamp() string

GetTimestamp returns the timestamp of the message, or "" if no timestamp is relevant

func (StopMessage) SetContent

func (m StopMessage) SetContent(content []byte)

SetContent updates the content the message

func (StopMessage) SetOrigin

func (m StopMessage) SetOrigin(Origin *MessageOrigin)

SetOrigin sets the integration from which the message comes

func (StopMessage) SetSeverity

func (m StopMessage) SetSeverity(severity []byte)

SetSeverity sets the severity of the message

func (StopMessage) SetTagsPayload

func (m StopMessage) SetTagsPayload(tagsPayload []byte)

SetSeverity sets the tags and sources of the message

Jump to

Keyboard shortcuts

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