hostscan

package
v0.0.0-...-0dfd57a Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Service hostscan scans the local network for devices and provides status updates.

Index

Constants

This section is empty.

Variables

View Source
var Module = &services.Module{
	Name:        "hostscan",
	Version:     "1.0",
	NewInstance: NewService,
}

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	Log    sfproto.Logger
	Client sarif.Client
}

type Host

type Host struct {
	Ip        string    `json:"ip"`
	Name      string    `json:"name,omitempty"`
	Time      time.Time `json:"time"`
	UpdatedAt time.Time `json:"-"`
	Status    string    `json:"status"`
}

func (Host) String

func (h Host) String() string

type HostRequest

type HostRequest struct {
	Host string `json:"host"`
}

type HostScan

type HostScan struct {
	MinDownInterval time.Duration
	// contains filtered or unexported fields
}

func New

func New() *HostScan

func (*HostScan) FindLocalNetwork

func (h *HostScan) FindLocalNetwork() (string, error)

func (*HostScan) LastStatus

func (h *HostScan) LastStatus(name string) (Host, error)

func (*HostScan) LastStatusAll

func (h *HostScan) LastStatusAll() ([]Host, error)

func (*HostScan) ScanCurrentHosts

func (h *HostScan) ScanCurrentHosts() ([]Host, error)

func (*HostScan) Update

func (h *HostScan) Update() ([]Host, error)

type Service

type Service struct {
	Log sfproto.Logger
	sarif.Client
	// contains filtered or unexported fields
}

func NewService

func NewService(deps *Dependencies) *Service

func (*Service) Enable

func (s *Service) Enable() error

func (*Service) HandleForceUpdate

func (s *Service) HandleForceUpdate(msg sarif.Message)

func (*Service) HandleLastStatus

func (s *Service) HandleLastStatus(msg sarif.Message)

func (*Service) Update

func (s *Service) Update() ([]Host, error)

Jump to

Keyboard shortcuts

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