ingest

package
v1.0.0-beta.66 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ingest implements event ingestion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	Ingest(ctx context.Context, namespace string, ev event.Event) error
	Close()
}

Collector is a receiver of events that handles sending those events to some downstream broker.

type DeduplicatingCollector

type DeduplicatingCollector struct {
	Collector

	Deduplicator dedupe.Deduplicator
}

DeduplicatingCollector implements event deduplication at event ingestion.

func (DeduplicatingCollector) Ingest

func (d DeduplicatingCollector) Ingest(ctx context.Context, namespace string, ev event.Event) error

Ingest implements the {Collector} interface wrapping an existing {Collector} and deduplicating events.

type InMemoryCollector

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

InMemoryCollector is a {Collector} backed by in-memory storage.

func NewInMemoryCollector

func NewInMemoryCollector() *InMemoryCollector

NewInMemoryCollector returns a new {Collector} backed by in-memory storage.

func (*InMemoryCollector) Close

func (c *InMemoryCollector) Close()

Close implements the {Collector} interface.

func (*InMemoryCollector) Events

func (c *InMemoryCollector) Events(namespace string) []event.Event

Events returns events ingested into a namespace.

func (*InMemoryCollector) Ingest

func (c *InMemoryCollector) Ingest(_ context.Context, namespace string, ev event.Event) error

Ingest implements the {Collector} interface.

func (*InMemoryCollector) Namespaces

func (c *InMemoryCollector) Namespaces() []string

Namespaces returns namespaces events were ingested into.

type IngestEventsRequest

type IngestEventsRequest struct {
	Namespace string
	Events    []event.Event
}

type Service

type Service struct {
	Collector Collector
	Logger    *slog.Logger
}

Service implements the ingestion service.

func (Service) IngestEvents

func (s Service) IngestEvents(ctx context.Context, request IngestEventsRequest) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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