gen2ingress

package
v4.15.9+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWorkQueueLength = 1000 * 1000 * 1000

Default queue size is 1GB

Variables

This section is empty.

Functions

func DialLoop

func DialLoop(ctx context.Context, target string, descriptor string, f DialProcessFunction)

func Gen2Ingress

func Gen2Ingress(driver Driver)

This is called by the main method of the driver-specific executable

func Loop

func Loop(ctx context.Context, descriptor string, f CustomProcessFunction)

Types

type CustomProcessFunction

type CustomProcessFunction func(ctx context.Context) error

type DialProcessFunction

type DialProcessFunction func(ctx context.Context, conn *net.TCPConn, r *bufio.Reader) error

type Driver

type Driver interface {
	//Which devices should this driver be assigned to
	///e.g "psl.pqube3"
	//It is a prefix of the descriptor
	DIDPrefix() string
	//Return false if we don't need to check the manifest
	// (no DIDPrefix)
	InitiatesConnections() bool
	//This is called early on
	SetConn(in *Inserter)
	//For devices that are connected TO, descriptors will be handed to the driver
	//from the manifest table
	HandleDevice(ctx context.Context, descriptor string) error
}

type InsertRecord

type InsertRecord struct {
	Data []btrdb.RawPoint
	//TODO this is not used
	Flags             []uint64
	Name              string
	Collection        string
	Unit              string
	AnnotationChanges map[string]string
}

func (*InsertRecord) Size

func (ir *InsertRecord) Size() int

type Inserter

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

func NewInserter

func NewInserter(db *btrdb.BTrDB) *Inserter

func (*Inserter) ProcessBatch

func (ins *Inserter) ProcessBatch(ir []InsertRecord)

func (*Inserter) SetCoalesceInterval

func (ins *Inserter) SetCoalesceInterval(d time.Duration)

Jump to

Keyboard shortcuts

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