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

collector

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

func New

func New(source Source, reporter Reporter, options Options) *Collector

func (*Collector) Run

func (c *Collector) Run(ctx context.Context) error

func (*Collector) Step

func (c *Collector) Step(ctx context.Context) error

type Diagnostic

type Diagnostic struct {
	Self      domain.NodeIdentity `json:"self"`
	OS        string              `json:"os"`
	PeerCount int                 `json:"peerCount"`
}

type DiagnosticSource

type DiagnosticSource interface {
	Diagnostic(context.Context) (Diagnostic, error)
}

type HTTPReporter

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

func NewHTTPReporter

func NewHTTPReporter(serverURL string, client *http.Client) (*HTTPReporter, error)

func (*HTTPReporter) Send

type HTTPStatusError

type HTTPStatusError struct {
	StatusCode int
	Status     string
	Message    string
}

func (*HTTPStatusError) Error

func (e *HTTPStatusError) Error() string

type Options

type Options struct {
	SampleInterval    time.Duration
	HeartbeatInterval time.Duration
	RetryMin          time.Duration
	RetryMax          time.Duration
	SummaryInterval   time.Duration
	ReporterInstance  string
	Now               func() time.Time
	Jitter            func() float64
	Wait              func(context.Context, time.Duration) error
	Logger            *slog.Logger
}

type PeerSnapshot

type PeerSnapshot struct {
	Identity domain.NodeIdentity
	RxBytes  int64
	TxBytes  int64
	Path     domain.PathObservation
}

type Reporter

type Reporter interface {
	Send(context.Context, domain.ReportEnvelope) (domain.ReportReceipt, error)
}

type Snapshot

type Snapshot struct {
	CollectedAt time.Time
	Observer    domain.NodeIdentity
	Peers       []PeerSnapshot
}

type Source

type Source interface {
	Snapshot(context.Context) (Snapshot, error)
}

Jump to

Keyboard shortcuts

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