observer

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 1 Imported by: 2 modules, 13 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package observer defines the Observer interface for collecting observability events such as connection status and traffic statistics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	Type() EventType
}

Event is a generic observability event. Implementations carry type-specific data such as connection counts or byte throughput.

type EventType

type EventType string

EventType categorizes an event.

const (
	// EventStatus indicates a service or connection status change.
	EventStatus EventType = "status"
	// EventStats indicates a traffic statistics snapshot.
	EventStats EventType = "stats"
)

type Observer

type Observer interface {
	// Observe processes a batch of events.
	Observe(ctx context.Context, events []Event, opts ...Option) error
}

Observer receives observability events from components. Events can include status changes, connection statistics snapshots, and other runtime diagnostics. Observers are typically used to feed data to monitoring dashboards or log systems.

type Option

type Option func(opts *Options)

Option is a functional option for configuring Options.

type Options

type Options struct{}

Options holds the initialization parameters for an Observer.

Directories

Path Synopsis
Package stats defines the Stats interface for tracking connection and traffic counters (total connections, current connections, bytes, errors).
Package stats defines the Stats interface for tracking connection and traffic counters (total connections, current connections, bytes, errors).

Jump to

Keyboard shortcuts

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