dependency

package
v0.3.20 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package dependency implements controller dependency database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database tracks dependencies between resources and controllers (and vice versa).

func NewDatabase

func NewDatabase() (*Database, error)

NewDatabase creates new Database.

func (*Database) AddControllerInput

func (db *Database) AddControllerInput(controllerName string, dep controller.Input) error

AddControllerInput adds a dependency of controller on a resource.

func (*Database) AddControllerOutput

func (db *Database) AddControllerOutput(controllerName string, out controller.Output) error

AddControllerOutput tracks which resource is managed by which controller.

func (*Database) DeleteControllerInput

func (db *Database) DeleteControllerInput(controllerName string, dep controller.Input) error

DeleteControllerInput adds a dependency of controller on a resource.

func (*Database) Export

func (db *Database) Export() (*controller.DependencyGraph, error)

Export dependency graph.

func (*Database) GetControllerInputs

func (db *Database) GetControllerInputs(controllerName string) ([]controller.Input, error)

GetControllerInputs returns a list of controller dependencies.

func (*Database) GetControllerOutputs

func (db *Database) GetControllerOutputs(controllerName string) ([]controller.Output, error)

GetControllerOutputs returns resource managed by controller.

This method is not optimized for performance and should be used only for debugging.

func (*Database) GetDependentControllers

func (db *Database) GetDependentControllers(dep controller.Input) ([]string, error)

GetDependentControllers returns a list of controllers which depend on resource change.

func (*Database) GetResourceExclusiveController

func (db *Database) GetResourceExclusiveController(resourceType resource.Type) (string, error)

GetResourceExclusiveController returns controller which has a resource as exclusive output.

If no controller manages a resource in exclusive mode, empty string is returned.

Jump to

Keyboard shortcuts

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