logger

package
v0.0.0-...-e5f8ed5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SleepTime is the duration to sleep for prior to polling for new messages in ObservationLog channel
	SleepTime = time.Microsecond * 100
	// BaseNanoseconds is the base denomination for converting duration
	BaseNanoseconds = 1000000000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BigQueryLogger

type BigQueryLogger interface {
	// contains filtered or unexported methods
}

BigQueryLogger defines methods implemented by the logger

type FluentdLogProducer

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

FluentdLogProducer captures configs for publishing ObservationLog via Fluentd to a configured sink

func NewFluentdLogProducer

func NewFluentdLogProducer(
	cfg config.FluentdConfig,
	metricsService services.MetricService,
) (*FluentdLogProducer, error)

NewFluentdLogProducer creates a new FluentdLogProducer

func (*FluentdLogProducer) Produce

func (p *FluentdLogProducer) Produce(observationLog *types.ObservationLogEntry)

Produce logs ObservationLog via Fluentd to the configured sink

type KafkaLogConsumer

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

KafkaLogConsumer captures configs for polling ObservationLog from a Kafka topic

func NewKafkaLogConsumer

func NewKafkaLogConsumer(
	cfg config.KafkaConfig,
	metricsService services.MetricService,
) (*KafkaLogConsumer, error)

NewKafkaLogConsumer initializes a KafkaLogConsumer struct

func (*KafkaLogConsumer) Consume

func (k *KafkaLogConsumer) Consume(logsChannel chan *types.ObservationLogEntry) error

Consume polls for ObservationLog from a Kafka topic to a buffered Go channel

type KafkaLogPublisher

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

KafkaLogPublisher captures configs for publishing ObservationLog to a Kafka topic

func NewKafkaLogProducer

func NewKafkaLogProducer(
	cfg config.KafkaConfig,
	metricsService services.MetricService,
) (*KafkaLogPublisher, error)

NewKafkaLogProducer initializes a KafkaLogPublisher struct

func (*KafkaLogPublisher) Produce

func (p *KafkaLogPublisher) Produce(observationLog *types.ObservationLogEntry)

Produce logs ObservationLog to a Kafka topic

type LogConsumer

type LogConsumer interface {
	Consume(logsChannel chan *types.ObservationLogEntry) error
}

LogConsumer captures the methods exposed by a ObservationLog consumer

type LogProducer

type LogProducer interface {
	Produce(log *types.ObservationLogEntry)
}

LogProducer captures the methods exposed by a ObservationLog producer

type NoopLogConsumer

type NoopLogConsumer struct{}

NoopLogConsumer is the struct for no operation to ObservationLog

func NewNoopLogConsumer

func NewNoopLogConsumer() (*NoopLogConsumer, error)

NewNoopLogConsumer initializes a NoopLogConsumer struct

func (*NoopLogConsumer) Consume

func (k *NoopLogConsumer) Consume(logsChannel chan *types.ObservationLogEntry) error

Consume does nothing to ObservationLog

type NoopLogProducer

type NoopLogProducer struct{}

NoopLogProducer is the struct for no operation to ObservationLog

func NewNoopLogProducer

func NewNoopLogProducer() (*NoopLogProducer, error)

NewNoopLogProducer initializes a NoopLogProducer struct

func (*NoopLogProducer) Produce

func (k *NoopLogProducer) Produce(log *types.ObservationLogEntry)

Produce does nothing to ObservationLog

type ObservationLogger

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

ObservationLogger captures the config related to consume and produce ObservationLog to data sources and sinks respectively

func NewObservationLogger

func NewObservationLogger(
	consumerConfig config.LogConsumerConfig,
	producerConfig config.LogProducerConfig,
	metricService services.MetricService,
) (*ObservationLogger, error)

NewObservationLogger initializes a ObservationLogger struct

func (*ObservationLogger) Consume

func (l *ObservationLogger) Consume(ctx context.Context) error

Consume runs the Consume method of the underlying configured LogConsumer

type StdOutLogProducer

type StdOutLogProducer struct{}

StdOutLogProducer captures configs for logging ObservationLog to standard output

func NewStdOutLogProducer

func NewStdOutLogProducer() (*StdOutLogProducer, error)

NewStdOutLogProducer initializes a StdOutLogProducer struct

func (*StdOutLogProducer) Produce

func (p *StdOutLogProducer) Produce(observationLog *types.ObservationLogEntry)

Produce logs ObservationLog to standard output

Jump to

Keyboard shortcuts

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