agent

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHttpListenerPort = "1234"

DefaultHttpListenerPort is used to set the URL where the logs will be sent by Logs API

View Source
const (
	MaxRetries = 3
)

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key, fallback string) string

func ListenOnAddress

func ListenOnAddress() string

Types

type FluentdLogger

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

func NewFluentdLogger

func NewFluentdLogger() (*FluentdLogger, error)

func (*FluentdLogger) PushLog

func (l *FluentdLogger) PushLog(log string) error

func (*FluentdLogger) Shutdown

func (l *FluentdLogger) Shutdown() error

type HttpAgent

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

HttpAgent has the listener that receives the logs and the logger that handles the received logs

func NewHttpAgent

func NewHttpAgent(fluentdLogger *FluentdLogger, jq *queue.Queue) (*HttpAgent, error)

NewHttpAgent returns an agent to listen and handle logs coming from Logs API for HTTP Make sure the agent is initialized by calling Init(agentId) before subscription for the Logs API.

func (HttpAgent) Init

func (a HttpAgent) Init(agentID string) error

Init initializes the configuration for the Logs API and subscribes to the Logs API for HTTP

func (*HttpAgent) Shutdown

func (a *HttpAgent) Shutdown()

Shutdown finalizes the logging and terminates the listener

type LogsApiHttpListener

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

LogsApiHttpListener is used to listen to the Logs API using HTTP

func NewLogsApiHttpListener

func NewLogsApiHttpListener(lq *queue.Queue) (*LogsApiHttpListener, error)

NewLogsApiHttpListener returns a LogsApiHttpListener with the given log queue

func (*LogsApiHttpListener) Shutdown

func (s *LogsApiHttpListener) Shutdown()

Shutdown terminates the HTTP server listening for logs

func (*LogsApiHttpListener) Start

func (s *LogsApiHttpListener) Start() (bool, error)

Start initiates the server in a goroutine where the logs will be sent

Jump to

Keyboard shortcuts

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