Documentation
¶
Overview ¶
Package filter implements the standard APRS-IS server-side packet filters (14 types):
a/ area (bounding box) b/ buddy (source callsign, wildcards) d/ used digipeater e/ entry station (q-construct igate) f/ friend range g/ message recipient m/ my range o/ object/item name p/ source prefix q/ q-construct r/ range (lat/lon/dist) s/ symbol t/ type (+ optional range) u/ unproto (destination)
A filter string is a space-separated list of specs. A leading '-' negates a spec (matching packets are dropped). Type letters and the q construct value are case-sensitive; callsign/prefix matching is not.
Stateful filters (m/, f/ and the ranged form of t/) need station positions, supplied by the caller through a Context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface {
// ClientPosition returns the requesting client's own last-known position.
// ok is false when the position is unknown (m/ then cannot match).
ClientPosition() (pos Position, ok bool)
// StationPosition returns the last-known position of an arbitrary station
// by callsign. ok is false when unknown.
StationPosition(callsign string) (pos Position, ok bool)
}
Context supplies stateful information that some filters need.
Implementations are provided by the server layer (e.g. backed by a historydb of last-known station positions). A nil Context is acceptable; stateful filters that need data the Context cannot provide simply do not match.
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter is a compiled, reusable set of filter specs.
func Compile ¶
Compile parses a filter string into a reusable Filter. Unknown or malformed specs are skipped but recorded in the raw string. It never returns an error; an empty or whitespace-only string yields a Filter that matches nothing.