handler

package
v0.0.0-...-6b92692 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckRes

type CheckRes struct {
	ResultsSensors []struct {
		UID      string `json:"uid"`
		SensorID string `json:"sensor_id"`
	}
	ResultsObs []struct {
		UID        string                   `json:"uid"`
		Ohash      string                   `json:"ohash"`
		SeenBySame []map[string]interface{} `json:"seen_by_same"`
	}
}

CheckRes is a struct to hold values looked up during import

type DgraphHandler

type DgraphHandler struct {
	Client                  *dgo.Dgraph
	BufChunks               []*observation.InputObservation
	SensorIDCacheUpdateLock sync.Mutex
	SensorIDCache           *cache.Cache
}

DgraphHandler is a Handler for balboa implemented to communicate with the Dgraph database

func (*DgraphHandler) CheckAndSetSchema

func (d *DgraphHandler) CheckAndSetSchema()

CheckAndSetSchema ensures that a schema is set on the database that is used in the handler.

func (*DgraphHandler) HandleBackup

func (d *DgraphHandler) HandleBackup(br *db.BackupRequest)

HandleBackup is not implemented yet.

func (*DgraphHandler) HandleDump

func (d *DgraphHandler) HandleDump(dr *db.DumpRequest, conn net.Conn)

HandleDump is not implemented yet.

func (*DgraphHandler) HandleObservations

func (d *DgraphHandler) HandleObservations(obs *observation.InputObservation)

HandleObservations processes a single observation for insertion.

func (*DgraphHandler) HandleQuery

func (d *DgraphHandler) HandleQuery(qr *db.QueryRequest, conn net.Conn)

HandleQuery implements a query for a combination of parameters.

type GetRes

type GetRes struct {
	ResultsObs []struct {
		Rrname string                   `json:"rrname"`
		Rdata  string                   `json:"rdata"`
		Rrtype string                   `json:"rrtype"`
		SeenBy []map[string]interface{} `json:"seen_by"`
	}
}

GetRes is a struct holding values to be returned from a query

Jump to

Keyboard shortcuts

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