Help us shape the future of Go! Take the 2026 Go Developer Survey

pipeline

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventPipeline

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

func NewEventPipeline

func NewEventPipeline(size int, sinks ...Sink) *EventPipeline

func (*EventPipeline) Close

func (p *EventPipeline) Close() error

func (*EventPipeline) CloseContext added in v0.7.0

func (p *EventPipeline) CloseContext(ctx context.Context) error

CloseContext bounds both legacy drain and the public sink lifecycle. Legacy callbacks cannot be interrupted, but a stuck callback cannot block teardown.

func (*EventPipeline) ConfigurePublic added in v0.7.0

func (p *EventPipeline) ConfigurePublic(policy attribution.Policy, sinks []event.Registration) error

ConfigurePublic installs per-sink transports before the pipeline serves.

func (*EventPipeline) DroppedEvents

func (p *EventPipeline) DroppedEvents() uint64

func (*EventPipeline) Enqueue

func (p *EventPipeline) Enqueue(v any) bool

func (*EventPipeline) PublicStats added in v0.7.0

func (p *EventPipeline) PublicStats() []event.Stats

func (*EventPipeline) Publish added in v0.7.0

func (p *EventPipeline) Publish(ctx context.Context, e event.Envelope) bool

Publish is the public boundary of the same authority that owns usage events. It only accepts the two explicit sanitized DTO families, never internal usage.

func (*EventPipeline) RejectedEvents added in v0.7.0

func (p *EventPipeline) RejectedEvents() uint64

func (*EventPipeline) Start

func (p *EventPipeline) Start()

func (*EventPipeline) WriteFailures

func (p *EventPipeline) WriteFailures() uint64

type OTelExporter

type OTelExporter interface {
	ExportUsageEvent(any) error
	Close() error
}

OTelExporter translates gateway usage events into OpenTelemetry spans, logs, or metrics without forcing an OpenTelemetry dependency into the gateway core.

Sinks are passed to NewEventPipeline at construction time, so wiring an exporter means editing the pipeline setup in caddy/gateway/app.go and standalone/server/server.go. There is no out-of-module registration seam.

type OpenTelemetrySink

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

func NewOpenTelemetrySink

func NewOpenTelemetrySink(exporter OTelExporter) *OpenTelemetrySink

func (*OpenTelemetrySink) Close

func (s *OpenTelemetrySink) Close() error

func (*OpenTelemetrySink) Write

func (s *OpenTelemetrySink) Write(ev any) error

type PrometheusSink

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

PrometheusSink is a dependency-free in-process sink that keeps counters in a shape the Admin API /metrics exposition layer renders into Prometheus text.

func NewPrometheusSink

func NewPrometheusSink() *PrometheusSink

func (*PrometheusSink) Close

func (s *PrometheusSink) Close() error

func (*PrometheusSink) PrometheusSnapshot

func (s *PrometheusSink) PrometheusSnapshot() usage.PrometheusSnapshot

PrometheusSnapshot satisfies usage.PrometheusProvider.

func (*PrometheusSink) Snapshot

func (s *PrometheusSink) Snapshot() usage.PrometheusSnapshot

func (*PrometheusSink) Write

func (s *PrometheusSink) Write(ev any) error

type SQLiteSink

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

func NewSQLiteSink

func NewSQLiteSink(provider usage.SQLDBProvider, cfg usage.Config) (*SQLiteSink, *sqlite.UsageQueries, error)

func (*SQLiteSink) Close

func (s *SQLiteSink) Close() error

func (*SQLiteSink) Write

func (s *SQLiteSink) Write(ev any) error

type Sink

type Sink interface {
	Write(any) error
	Close() error
}

Jump to

Keyboard shortcuts

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