db

package
v0.0.0-...-56a9bdf Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidDBPlugin = errors.New("Invalid DB plugin in config file")
	ErrNotExist        = errors.New("Value does not exist")
)

Functions

This section is empty.

Types

type DatabasePackage

type DatabasePackage interface {

	// (no args)
	Init() error

	// (agent advertisement to set)
	SetAgent(defs.AgentAdvert) error

	GetAgent(string) (*defs.AgentAdvert, error)
	GetAgents() ([]defs.AgentAdvert, error)

	// (agent advertisement to remove)
	RemoveAgent(defs.AgentAdvert) error

	SetObject(objects.ToddObject) error
	GetObjects(string) ([]objects.ToddObject, error)
	DeleteObject(string, string) error

	GetGroupMap() (map[string]string, error)
	SetGroupMap(map[string]string) error

	// Testing
	InitTestRun(string, map[string]map[string]string) error
	SetAgentTestStatus(string, string, string) error
	GetTestStatus(string) (map[string]string, error)
	SetAgentTestData(string, string, string) error
	GetAgentTestData(string, string) (map[string]string, error)
	WriteCleanTestData(string, string) error
	GetCleanTestData(string) (string, error)
}

DatabasePackage represents all of the behavior that a ToDD database plugin must support

func NewToddDB

func NewToddDB(cfg config.Config) (DatabasePackage, error)

NewToddDB will create a new instance of toddDatabase, and load the desired databasePackage-compatible comms package into it.

Jump to

Keyboard shortcuts

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