tracker

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interest

type Interest struct {
	Host   string `json:"host"`
	Path   string `json:"path"`
	Method string `json:"method"`
}

func (*Interest) Id

func (i *Interest) Id() string

type InterestTracker

type InterestTracker struct {
	Interests         *Interests
	OTELMeter         metric.Meter
	NumberOfInterests metric.Int64Gauge
	// contains filtered or unexported fields
}

InterestTracker tracks hosts and their discovered WebSocket and request/reply connection handlers.

func NewInterestTracker

func NewInterestTracker(nc *nats.Conn, opts ...InterestTrackerOption) *InterestTracker

func (*InterestTracker) Run

func (it *InterestTracker) Run() error

func (*InterestTracker) ValidRequest

func (it *InterestTracker) ValidRequest(req http.Request) bool

type InterestTrackerOption added in v0.0.8

type InterestTrackerOption func(*InterestTracker)

func WithInterestSubject added in v0.0.8

func WithInterestSubject(subject string) InterestTrackerOption

func WithOTELMeter added in v0.0.8

func WithOTELMeter(meter metric.Meter) InterestTrackerOption

type Interests

type Interests struct {
	sync.RWMutex
	InterestMap  map[string]*Interest
	InterestSeen map[string]time.Time
}

func (*Interests) Add

func (i *Interests) Add(interest *Interest)

func (*Interests) RunEvictions

func (i *Interests) RunEvictions()

Jump to

Keyboard shortcuts

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