fake

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: ISC Imports: 5 Imported by: 0

Documentation

Overview

Package fake implements fake versions of the C functions imported from the collectd daemon for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAll

func ReadAll() error

func SetInterval

func SetInterval(d time.Duration)

SetInterval sets the interval returned by the fake plugin_get_interval() function.

func ShutdownAll

func ShutdownAll() error

ShutdownAll calls all registered shutdown callbacks.

func TearDown

func TearDown()

TearDown cleans up after a test and prepares shared resources for the next test.

Note that this only resets the state of the fake implementations, such as "plugin_register_log()". The Go code in "collectd.org/plugin" may still hold a reference to the callback even after this function has been called.

Types

type ReadCallback

type ReadCallback struct {
	Group, Name string
	Interval    cdtime.Time
}

ReadCallback represents a data associated with a registered read callback.

func ReadCallbacks

func ReadCallbacks() []ReadCallback

ReadCallbacks returns the data associated with all registered read callbacks.

Jump to

Keyboard shortcuts

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