database

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: AGPL-3.0 Imports: 3 Imported by: 5 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Adapters = map[string]Connect{}

Adapters is the list of registered database adapters

Functions

func RegisterAdapter

func RegisterAdapter(name string, n Connect)

Types

type Config

type Config struct {
	DeleteInterval duration.Duration `toml:"delete_interval"` // Delete stats of nodes every n minutes
	DeleteAfter    duration.Duration `toml:"delete_after"`    // Delete stats of nodes till now-deletetill n minutes
	Connection     map[string]interface{}
}

type Connect

type Connect func(config map[string]interface{}) (Connection, error)

Connect function with config to get DB connection interface

type Connection

type Connection interface {
	// InsertNode stores statistics per node
	InsertNode(node *runtime.Node)

	// InsertLink stores statistics per link
	InsertLink(*runtime.Link, time.Time)

	// InsertGlobals stores global statistics
	InsertGlobals(*runtime.GlobalStats, time.Time, string, string)

	// PruneNodes prunes historical per-node data
	PruneNodes(deleteAfter time.Duration)

	// Close closes the database connection
	Close()
}

Connection interface to use for implementation in e.g. influxdb

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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