ng_graph

package
v1.0.5-0...-0e34edc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CYPHER_NODE_BY_ID    = "MATCH (n:NetAssistNode) WHERE Id(n)={0} RETURN n"
	CYPHER_NODE_FROM_ID  = "MATCH (n:NetAssistNode) WHERE Id(n) > {0} RETURN Id(n), n ORDER BY Id(n) LIMIT {1}"
	CYPHER_NODES_COUNT   = "MATCH (n:NetAssistNode) RETURN count(n)"
	CYPHER_LINK_BY_ID    = "MATCH (n:NetAssistNode)-[r:LINKS_TO]->(c:NetAssistNode) WHERE Id(r)={0} RETURN r"
	CYPHER_LINKS_FROM_ID = "MATCH (n:NetAssistNode)-[r:LINKS_TO]->(c:NetAssistNode) WHERE Id(r) > {0} RETURN Id(r), Id(n), Id(c), r LIMIT {1}"
	CYPHER_LINKS_COUNT   = "MATCH (n:NetAssistNode)-[r:LINKS_TO]->(c:NetAssistNode) RETURN count(r)"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphStorage

type GraphStorage interface {
	GetNodeById(id int64) (Host, error)
	GetAllNodesFrom(from_id int64, n_take int32) ([]Host, error)
	GetLinkById(id int64) (Link, error)
	GetAllLinksFrom(from_id int64, n_take int32) ([]Link, error)
	GetNodesCount() (int32, error)
	GetLinksCount() (int32, error)
}

type Host

type Host struct {
	Id               int64
	DBImportSwitchId int32
	Name             string
	IcingaName       string
	IP               net.IP
	IP6              net.IP
	MACAddress       string
	Address          string
	Comment          string
	Model            string
	Serial           string
	NumPorts         uint16
	Type             NodeType
}

Host

type Link struct {
	Id          int64
	SrcImportId int32
	DstImportId int32
	SrcPort     uint16
	DstPort     uint16
	SrcNodeId   int64
	DstNodeId   int64

	CapacityMbit int64
	Quality      int32
	Type         LinkType
	Comment      string

	RXOctetsMetric string
	TXOctetsMetric string
}

Link

type LinkType

type LinkType int16

LinkType

const (
	LINK_FIBER           LinkType = 0
	LINK_FIBER_TRANSPORT LinkType = 1
	LINK_COPPER          LinkType = 2
	LINK_RADIO_WB        LinkType = 3
	LINK_RADIO_80211_5   LinkType = 4
	LINK_RADIO_80211_2   LinkType = 5
	LINK_RADIO_LB        LinkType = 6
	LINK_GSM             LinkType = 7
	LINK_X25             LinkType = 8
	LINK_POWERLINE       LinkType = 9
)

type NeoGraphStorage

type NeoGraphStorage struct {
	// contains filtered or unexported fields
}

func NewNeoGraphStorage

func NewNeoGraphStorage(url string) *NeoGraphStorage

func (*NeoGraphStorage) GetAllLinksFrom

func (s *NeoGraphStorage) GetAllLinksFrom(from_id int64, n_take int32) ([]Link, error)

func (*NeoGraphStorage) GetAllNodesFrom

func (s *NeoGraphStorage) GetAllNodesFrom(from_id int64, n_take int32) ([]Host, error)

func (*NeoGraphStorage) GetLinkById

func (s *NeoGraphStorage) GetLinkById(id int64) (Link, error)

func (*NeoGraphStorage) GetLinksCount

func (s *NeoGraphStorage) GetLinksCount() (int32, error)

func (*NeoGraphStorage) GetNodeById

func (s *NeoGraphStorage) GetNodeById(id int64) (Host, error)

func (*NeoGraphStorage) GetNodesCount

func (s *NeoGraphStorage) GetNodesCount() (int32, error)

type NodeType

type NodeType int16
const (
	NODE_SWITCH          NodeType = 0
	NODE_SERVER          NodeType = 1
	NODE_ROUTER          NodeType = 2
	NODE_TRANSPORT       NodeType = 3
	NODE_WIRELESS_AP     NodeType = 4
	NODE_WIRELESS_BRIDGE NodeType = 5
	NODE_OTHER           NodeType = 6
)

Jump to

Keyboard shortcuts

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