database

package
v0.0.0-...-73a5168 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoProjectNode = errors.New("No project node found")
View Source
var ErrNoSuchPackage = errors.New("no such package")

Functions

func CheckSchema

func CheckSchema(checkSchema string) bool

Types

type DataBase

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

func Setup

func Setup(dbAddr string, queueWorkers int) (*DataBase, error)

Setup connects to dgraph and returns the instance

func (*DataBase) AddDiagnosticNodes

func (db *DataBase) AddDiagnosticNodes(nodeID string, diagnosticnodes ...*service.DiagnosticNode) error

AddDiagnosticNodes stores the given DiagnosticNodes in a PackageNode or FileNode identified by the nodeID

func (*DataBase) AddFileNode

func (db *DataBase) AddFileNode(node *service.FileNode)

AddBuildFileNode adds a node to the insert queue in build phase

func (*DataBase) AddFileNodes

func (db *DataBase) AddFileNodes(nodeID string, filenodes ...*service.FileNode) error

AddFileNodes stores the given FileNodes in the FileNode identified by the nodeID

func (*DataBase) AddInfoNodes

func (db *DataBase) AddInfoNodes(nodeID string, infonodes ...*service.InfoNode) error

AddInfoNodes stores the given InfoNodes in a PackageNode or FileNode identified by the nodeID

func (*DataBase) AddPackageFileNodes

func (db *DataBase) AddPackageFileNodes(nodeID string, filenodes ...*service.FileNode) error

AddPackageFileNodes stores the given FileNodes in a PackageNode identified by the nodeID

func (*DataBase) AddPackageNode

func (db *DataBase) AddPackageNode(node *service.PackageNode)

AddPackageNode adds a node to the insert queue

func (*DataBase) AddProjectNode

func (db *DataBase) AddProjectNode(node *service.ProjectNode)

AddProjectNode adds a node to the insert queue

func (*DataBase) AddQmstrStateNode

func (db *DataBase) AddQmstrStateNode(qNode *service.QmstrStateNode) (string, error)

func (*DataBase) CloseInsertQueue

func (db *DataBase) CloseInsertQueue()

func (*DataBase) GetAllInfoData

func (db *DataBase) GetAllInfoData(infotype string) ([]string, error)

func (*DataBase) GetAnalyzerByName

func (db *DataBase) GetAnalyzerByName(name string) (*service.Analyzer, error)

func (*DataBase) GetDiagnosticNodeBySeverity

func (db *DataBase) GetDiagnosticNodeBySeverity(diagnosticNode *service.DiagnosticNode) ([]*service.DiagnosticNode, error)

GetDiagnosticNodeBySeverity queries diagnostic nodes on a specific severity

func (*DataBase) GetFileNodeHashByPath

func (db *DataBase) GetFileNodeHashByPath(path string) (string, error)

func (*DataBase) GetFileNodeUid

func (db *DataBase) GetFileNodeUid(hash string) (string, error)

GetFileNodeUid returns the UID of the node if exists otherwise ""

func (*DataBase) GetFileNodesByFileNode

func (db *DataBase) GetFileNodesByFileNode(filenode *service.FileNode, recursive bool) ([]*service.FileNode, error)

GetFileNodesByFileNode queries filenodes on a specific attribute of a provided filenode. For instance, you can provide a filenode with a certain filetype and get all the filenodes with this filetype. You can query for just one attribute. For instance, if you set filetype and hash, only the hash will be used in the query.

func (*DataBase) GetInfoData

func (db *DataBase) GetInfoData(rootNodeID string, infotype string, datatype string) ([]string, error)

func (*DataBase) GetInfoNodeByDataNode

func (db *DataBase) GetInfoNodeByDataNode(infonodetype string, datanodes ...*service.InfoNode_DataNode) (*service.InfoNode, error)

func (*DataBase) GetNodesByType

func (db *DataBase) GetNodesByType(valuetype string, recursive bool, namefilter string) ([]*service.FileNode, error)

func (*DataBase) GetPackageNode

func (db *DataBase) GetPackageNode() (*service.PackageNode, error)

func (*DataBase) GetPackageNodeByName

func (db *DataBase) GetPackageNodeByName(name string) (*service.PackageNode, error)

func (*DataBase) GetProjectNode

func (db *DataBase) GetProjectNode() (*service.ProjectNode, error)

func (*DataBase) GetQmstrStateNode

func (db *DataBase) GetQmstrStateNode() (*service.QmstrStateNode, error)

func (*DataBase) OpenInsertQueue

func (db *DataBase) OpenInsertQueue()

func (*DataBase) Sync

func (db *DataBase) Sync()

Jump to

Keyboard shortcuts

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