Documentation ¶
Overview ¶
Package dependency implements the dependency handling database.
Index ¶
- Constants
- func Equal(a, b *controller.Input) bool
- func EqualKeys(a, b *controller.Input) bool
- func Less(a, b *controller.Input) bool
- type ControllerInput
- type ControllerOutput
- type Database
- func (db *Database) AddControllerInput(controllerName string, dep controller.Input) error
- func (db *Database) AddControllerOutput(controllerName string, out controller.Output) error
- func (db *Database) DeleteControllerInput(controllerName string, dep controller.Input) error
- func (db *Database) Export() (*controller.DependencyGraph, error)
- func (db *Database) GetControllerInputs(controllerName string) ([]controller.Input, error)
- func (db *Database) GetControllerOutputs(controllerName string) ([]controller.Output, error)
- func (db *Database) GetDependentControllers(dep controller.Input) ([]string, error)
- func (db *Database) GetResourceExclusiveController(resourceType resource.Type) (string, error)
Constants ¶
const StarID = "*"
StarID denotes ID value which matches any other ID.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
func Equal(a, b *controller.Input) bool
Equal checks if two controller.Dependency objects are completely equivalent.
func EqualKeys ¶
func EqualKeys(a, b *controller.Input) bool
EqualKeys checks if two controller.Dependency objects have equal (conflicting) keys.
func Less ¶
func Less(a, b *controller.Input) bool
Less compares two controller.Dependency objects.
This sort order is compatible with the way memdb handles ordering.
Types ¶
type ControllerInput ¶
type ControllerInput struct { ControllerName string Namespace resource.Namespace Type resource.Type ID resource.ID Kind controller.InputKind }
ControllerInput tracks inputs of the controller.
type ControllerOutput ¶
type ControllerOutput struct { Type resource.Type ControllerName string Kind controller.OutputKind }
ControllerOutput tracks which objects are managed by controllers.
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database tracks dependencies between resources and controllers (and vice versa).
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.
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 ¶
GetResourceExclusiveController returns controller which has a resource as exclusive output.
If no controller manages a resource in exclusive mode, empty string is returned.