observer

package
v0.0.0-...-81c6b1d Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MaxTTLCount = 15
	MaxMacCount = 3
	MaxUaCount  = 5
)

Variables

View Source
var (
	TTLObserver    = newObserver[uint8](types.ZSetObserverTTL, MaxTTLCount, false)
	MacObserver    = newObserver[string](types.ZSetObserverMac, MaxMacCount, true)
	UaObserver     = newObserver[string](types.ZSetObserverUa, MaxUaCount, true)
	DeviceObserver = newObserver[types.DeviceRecord](types.ZSetObserverDevice, MaxMacCount, true)

	TTLEvents    = make(chan ChangeObserverEvent[uint8], 100)
	MacEvents    = make(chan ChangeObserverEvent[string], 100)
	UaEvents     = make(chan ChangeObserverEvent[string], 100)
	DeviceEvents = make(chan ChangeObserverEvent[types.DeviceRecord], 100)
)

Functions

func CleanUp

func CleanUp()

func Setup

func Setup()

Types

type ChangeObserverEvent

type ChangeObserverEvent[T any] struct {
	IP   string
	Prev T
	Curr T
}

ChangeObserverEvent 观察事件

type WebResult

type WebResult[T any] struct {
	IP      string           `json:"ip"`
	History changeHistory[T] `json:"history"`
}

Jump to

Keyboard shortcuts

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