persisters

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOUI

func GetOUI(mac string) (uint64, error)

Types

type ExternalSource

type ExternalSource struct {
	SourceURL       string
	DestinationPath string
}

func (*ExternalSource) PullIfNotExists

func (s *ExternalSource) PullIfNotExists() error

type MAC2VendorPersister

type MAC2VendorPersister struct {
	*SQLite
	*ExternalSource
}

func NewMAC2VendorPersister

func NewMAC2VendorPersister(dbPath string, sourceURL string) *MAC2VendorPersister

func (*MAC2VendorPersister) GetVendor

func (*MAC2VendorPersister) Open

func (d *MAC2VendorPersister) Open() error

type NodeAndPortScanPersister

type NodeAndPortScanPersister struct {
	*SQLite
}

func NewNodeAndPortScanPersister

func NewNodeAndPortScanPersister(dbPath string) *NodeAndPortScanPersister

func (*NodeAndPortScanPersister) CreateNode

func (d *NodeAndPortScanPersister) CreateNode(node *models.Node) error

func (*NodeAndPortScanPersister) CreateNodeScan

func (d *NodeAndPortScanPersister) CreateNodeScan(nodeScan *models.NodeScan) error

func (*NodeAndPortScanPersister) CreatePort

func (d *NodeAndPortScanPersister) CreatePort(port *models.Port) error

func (*NodeAndPortScanPersister) CreatePortScan

func (d *NodeAndPortScanPersister) CreatePortScan(portScan *models.PortScan) error

func (*NodeAndPortScanPersister) GetLatestPortScanForNodeId

func (d *NodeAndPortScanPersister) GetLatestPortScanForNodeId(macAddress string) (*models.PortScan, error)

func (*NodeAndPortScanPersister) GetLookbackNodes

func (d *NodeAndPortScanPersister) GetLookbackNodes() (models.NodeSlice, error)

func (*NodeAndPortScanPersister) GetNodeByMACAddress

func (d *NodeAndPortScanPersister) GetNodeByMACAddress(macAddress string) (*models.Node, error)

func (*NodeAndPortScanPersister) GetNodeScan

func (d *NodeAndPortScanPersister) GetNodeScan(nodeScanID int64) (*models.NodeScan, error)

func (*NodeAndPortScanPersister) GetNodeScans

func (d *NodeAndPortScanPersister) GetNodeScans() (models.NodeScanSlice, error)

func (*NodeAndPortScanPersister) GetNodes

func (d *NodeAndPortScanPersister) GetNodes(nodeScanID int64) (models.NodeSlice, error)

func (*NodeAndPortScanPersister) GetPortScan

func (d *NodeAndPortScanPersister) GetPortScan(portScanID int64) (*models.PortScan, error)

func (*NodeAndPortScanPersister) GetPortScans

func (d *NodeAndPortScanPersister) GetPortScans(nodeID int64) (models.PortScanSlice, error)

func (*NodeAndPortScanPersister) GetPorts

func (d *NodeAndPortScanPersister) GetPorts(portScanID int64) (models.PortSlice, error)

func (*NodeAndPortScanPersister) UpdateNodeScan

func (d *NodeAndPortScanPersister) UpdateNodeScan(nodeScan *models.NodeScan) error

func (*NodeAndPortScanPersister) UpdatePortScan

func (d *NodeAndPortScanPersister) UpdatePortScan(portScan *models.PortScan) error

type NodeWakePersister

type NodeWakePersister struct {
	*SQLite
}

func NewNodeWakePersister

func NewNodeWakePersister(dbPath string) *NodeWakePersister

func (*NodeWakePersister) CreateNodeWake

func (d *NodeWakePersister) CreateNodeWake(nodeWake *models.NodeWake) error

func (*NodeWakePersister) GetNodeWakes

func (d *NodeWakePersister) GetNodeWakes() (models.NodeWakeSlice, error)

func (*NodeWakePersister) UpdateNodeWake

func (d *NodeWakePersister) UpdateNodeWake(nodeWake *models.NodeWake) error

type Packet

type Packet struct {
	Port   int
	Packet []byte
}

type Ports2PacketPersister

type Ports2PacketPersister struct {
	*ExternalSource
	// contains filtered or unexported fields
}

func NewPorts2PacketPersister

func NewPorts2PacketPersister(dbPath string, sourceURL string) *Ports2PacketPersister

func (*Ports2PacketPersister) GetPacket

func (d *Ports2PacketPersister) GetPacket(port int) (*Packet, error)

func (*Ports2PacketPersister) Open

func (d *Ports2PacketPersister) Open() error

type RawPacket

type RawPacket struct {
	Port   int    `csv:"port"`
	Packet string `csv:"packet"`
}

type SQLite

type SQLite struct {
	DBPath     string
	Migrations migrate.MigrationSource
	// contains filtered or unexported fields
}

func (*SQLite) Open

func (d *SQLite) Open() error

type Service

type Service struct {
	ServiceName             string `csv:"Service Name"`
	PortNumber              string `csv:"Port Number"`
	TransportProtocol       string `csv:"Transport Protocol"`
	Description             string `csv:"Description"`
	Assignee                string `csv:"Assignee"`
	Contact                 string `csv:"Contact"`
	RegistrationDate        string `csv:"Registration Date"`
	ModificationDate        string `csv:"Modification Date"`
	Reference               string `csv:"Reference"`
	ServiceCode             string `csv:"Service Code"`
	UnauthorizedUseReported string `csv:"Unauthorized Use Reported"`
	AssignmentNotes         string `csv:"Assignment Notes"`
}

type ServiceNamesPortNumbersPersister

type ServiceNamesPortNumbersPersister struct {
	*ExternalSource
	// contains filtered or unexported fields
}

func NewServiceNamesPortNumbersPersister

func NewServiceNamesPortNumbersPersister(dbPath string, sourceURL string) *ServiceNamesPortNumbersPersister

func (*ServiceNamesPortNumbersPersister) GetService

func (d *ServiceNamesPortNumbersPersister) GetService(port int, protocol string) ([]Service, error)

GetService returns the services that match the port and protocol given Use "*" as the protocol to find all services on the port independent of protocol

func (*ServiceNamesPortNumbersPersister) Open

Jump to

Keyboard shortcuts

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