Version: v0.0.2 Latest Latest

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

Go to latest
Published: May 5, 2018 License: AGPL-3.0 Imports: 12 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Collector

type Collector struct {
	// contains filtered or unexported fields

Collector for a specificle respond messages

func NewCollector

func NewCollector(db database.Connection, nodes *runtime.Nodes, sitesDomains map[string][]string, ifaces []InterfaceConfig) *Collector

NewCollector creates a Collector struct

func (*Collector) Close

func (coll *Collector) Close()

Close Collector

func (*Collector) SendPacket

func (coll *Collector) SendPacket(destination net.IP)

SendPacket sends a UDP request to the given unicast or multicast address on the first UDP socket

func (*Collector) Start

func (coll *Collector) Start(interval time.Duration)

Start Collector

type Config

type Config struct {
	Enable          bool                  `toml:"enable"`
	Synchronize     duration.Duration     `toml:"synchronize"`
	Interfaces      []InterfaceConfig     `toml:"interfaces"`
	Sites           map[string]SiteConfig `toml:"sites"`
	CollectInterval duration.Duration     `toml:"collect_interval"`

func (*Config) SitesDomains

func (c *Config) SitesDomains() (result map[string][]string)

type InterfaceConfig

type InterfaceConfig struct {
	InterfaceName    string `toml:"ifname"`
	IPAddress        string `toml:"ip_address"`
	SendNoRequest    bool   `toml:"send_no_request"`
	MulticastAddress string `toml:"multicast_address"`
	Port             int    `toml:"port"`

type Response

type Response struct {
	Address *net.UDPAddr
	Raw     []byte

Response of the respond request

type SiteConfig

type SiteConfig struct {
	Domains []string `toml:"domains"`

Jump to

Keyboard shortcuts

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