Documentation ¶
Index ¶
- func SetFlags(fs *pflag.FlagSet, cfg *Config)
- type Config
- type Store
- func (cs *Store) AddDevice(ctx context.Context, newdevice model.Device) error
- func (cs *Store) AddNetflows(ctx context.Context, flows []model.IpFlow) (err error)
- func (cs *Store) AddNetwork(ctx context.Context, newnetwork model.Network) error
- func (cs *Store) Close() error
- func (cs *Store) CountDevices(ctx context.Context) int
- func (cs *Store) CountNetworks(ctx context.Context) int
- func (cs *Store) FlowSummaryByCountry(ctx context.Context, addr model.Addr) ([]model.FlowSummaryForAddrByCountry, error)
- func (cs *Store) FlowSummaryByIP(ctx context.Context, addr model.Addr) ([]model.FlowSummaryForAddrByIP, error)
- func (cs *Store) FlowSummaryByName(ctx context.Context, addr model.Addr) ([]model.FlowSummaryForAddrByName, error)
- func (cs *Store) GetAsn(ctx context.Context, asn string) (am model.Asn, err error)
- func (cs *Store) GetDeviceByAddr(ctx context.Context, addr model.Addr) (model.Device, error)
- func (cs *Store) GetFilteredDevices(ctx context.Context, filter model.DeviceFilter) []model.Device
- func (cs *Store) GetFilteredNetworks(ctx context.Context, filter model.NetworkFilter) []model.Network
- func (cs *Store) GetNetflows(ctx context.Context, addr model.Addr) (flows []model.IpFlow, err error)
- func (cs *Store) GetNetworkByName(ctx context.Context, name string) (model.Network, error)
- func (cs *Store) ListDevices(ctx context.Context) []model.Device
- func (cs *Store) ListNetworks(ctx context.Context) []model.Network
- func (cs *Store) ReadPerformancePings(ctx context.Context, device model.Device, duration time.Duration) (points []pinger.Point, err error)
- func (cs *Store) RemoveDeviceByAddr(ctx context.Context, addr model.Addr) error
- func (cs *Store) RemoveNetworkByName(ctx context.Context, name string) error
- func (cs *Store) StartAsnLoad() func(*error)
- func (cs *Store) UpdateDevice(ctx context.Context, newdevice model.Device) (enrich bool, err error)
- func (cs *Store) UpdateNetwork(ctx context.Context, newnetwork model.Network) error
- func (cs *Store) UpsertAsn(ctx context.Context, asn model.Asn) error
- func (cs *Store) UpsertNetwork(ctx context.Context, newnetwork model.Network) (err error)
- func (cs *Store) WritePerformancePing(ctx context.Context, timestamp time.Time, device model.Device, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct { DB *sqlite.Conn Pool *sqlitemigration.Pool // contains filtered or unexported fields }
func (*Store) AddDevice ¶
AddDevice adds a device to the store, will return error if the device already exists
func (*Store) AddNetflows ¶
AddNetflows adds a network to the store, will return error if the network already exists in the store
func (*Store) AddNetwork ¶
AddNetwork adds a network to the store, will return error if the network already exists in the store
func (*Store) CountDevices ¶
CountDevices return the number of devices in the store
func (*Store) CountNetworks ¶
CountNetworks returns the number of networks in the store
func (*Store) FlowSummaryByCountry ¶
func (*Store) FlowSummaryByIP ¶
func (*Store) FlowSummaryByName ¶
func (*Store) GetDeviceByAddr ¶
GetDeviceByAddr returns the device with the matching Addr
func (*Store) GetFilteredDevices ¶
func (cs *Store) GetFilteredDevices( ctx context.Context, filter model.DeviceFilter, ) []model.Device
GetFilteredDevices returns the devices which match the given GetFilteredDevices
func (*Store) GetFilteredNetworks ¶
func (cs *Store) GetFilteredNetworks( ctx context.Context, filter model.NetworkFilter, ) []model.Network
GetFilteredNetworks returns the networks which match the given GetFilteredNetworks
func (*Store) GetNetflows ¶
func (*Store) GetNetworkByName ¶
GetNetworkByName returns a network with the given name
func (*Store) ListDevices ¶
ListDevices returns all the stored devices
func (*Store) ListNetworks ¶
ListNetworks returns all stored networks
func (*Store) ReadPerformancePings ¶
func (cs *Store) ReadPerformancePings( ctx context.Context, device model.Device, duration time.Duration, ) (points []pinger.Point, err error)
ReadPoints returns the points from Now() minus the duration for the given type
func (*Store) RemoveDeviceByAddr ¶
RemoveDeviceByAddr will remove the device with the given Addr from the store
func (*Store) RemoveNetworkByName ¶
RemoveNetworkByName remove the named network from the store
func (*Store) StartAsnLoad ¶ added in v0.3.11
func (*Store) UpdateDevice ¶
func (cs *Store) UpdateDevice( ctx context.Context, newdevice model.Device, ) (enrich bool, err error)
UpdateDevice will fresnen up the device using the given device
func (*Store) UpdateNetwork ¶
UpdateNetwork will freshen up the network using the given network