adapter

package
v0.0.0-...-ce628f6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	MaxIngestSize  int
	ZapiUrl        string
	ZapiToken      string
	VerifySsl      bool
	DeploymentName string
	Hostname       string
	Platform       string
	FlushTimeout   time.Duration
	Queue          chan ContainerLogMessage
}

func New

func New(zapiUrl string, zapiToken string, verifySsl bool,
	deploymentName string, hostname string, platform string,
	maxIngestSize int, flushTimeout int) *Adapter

func (*Adapter) Stream

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

type ContainerLogMessage

type ContainerLogMessage struct {
	Message string `json:"message"`
	Source  string `json:"source"`
	// Timestamp on log message from container log
	EpochNanos       int64         `json:"epoch_nanos"`
	Collector        string        `json:"collector"`
	ZeDeploymentName string        `json:"ze_deployment_name"`
	Container        ContainerMeta `json:"container"`
}

Message structure:

type ContainerMeta

type ContainerMeta struct {
	Name     string            `json:"name"`
	Id       string            `json:"id"`
	Image    string            `json:"image"`
	Hostname string            `json:"hostname"`
	Labels   map[string]string `json:"labels"`
}

type IngestRequest

type IngestRequest struct {
	LogType  string   `json:"log_type"`
	Messages []string `json:"messages"`
}

Jump to

Keyboard shortcuts

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