Files
Mellaris/ruleset/builtins/geo/interface.go
Hayzam Sherif 94e1e26cc3
Some checks failed
Quality check / Static analysis (push) Has been cancelled
Quality check / Tests (push) Has been cancelled
First Commit
2026-02-11 06:27:36 +05:30

28 lines
439 B
Go

package geo
import (
"fmt"
"net"
"git.difuse.io/Difuse/Mellaris/ruleset/builtins/geo/v2geo"
)
type HostInfo struct {
Name string
IPv4 net.IP
IPv6 net.IP
}
func (h HostInfo) String() string {
return fmt.Sprintf("%s|%s|%s", h.Name, h.IPv4, h.IPv6)
}
type GeoLoader interface {
LoadGeoIP() (map[string]*v2geo.GeoIP, error)
LoadGeoSite() (map[string]*v2geo.GeoSite, error)
}
type hostMatcher interface {
Match(HostInfo) bool
}