Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CodeActivated is a reason code indicating that an element has been activated. CodeActivated = iota // CodeAlreadyActive is a reason code indicating that an element is active already. CodeAlreadyActive = iota // CodeChildActive is a reason code indicating that an element's child is currently active. CodeChildActive = iota // CodeParentPending is a reason code indicating that the element's parent has precedence. CodeParentPending = iota // CodeParentActive is a reason code indicating that the element's parent is currently active. CodeParentActive = iota // CodeParentNotReconciled is a reason code indicating that the element's parent has not yet been reconciled. CodeParentNotReconciled = iota // CodeParentUnknown is a reason code indicating that the element's parent is not (yet) known. CodeParentUnknown = iota // CodeOther is a reason code for unspecified reasons. CodeOther = iota )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element interface { // GetID returns the ID of the element. GetID() ID // GetParent returns the ID of the element's parent. GetParentID() ID }
Element describes the interface for getting the id an its parent.
type ID ¶
type ID interface { // String returns the string representation of the id. String() string }
ID describes the interface for an unique identifier of an object.
type Interface ¶
type Interface interface { // TestAndActivate decides whether the given Element is allowed to be activated (with respected to whether it has // been modified and/or inhibitChildren). TestAndActivate(Element, bool, bool) (bool, *Reason) // Done marks the given ID as "done" (meaning that a reconciliation has been executed successful). Done(ID) bool // Delete deletes the given ID from the internal state. Delete(ID) // MarkStatic marks an identifier as "static" (meaning that it has no parent represented by another ID). MarkStatic(ID) // UnmarkStatic unmarks an identifer as "static". UnmarkStatic(ID) // Reset resets the internal state of the scheduler. Reset() }
Interface describes the interface for interacting with the reconcile scheduler. It holds an internal state of elements and answers "may I schedule this element now" questions.
func New ¶
func New(logger logrus.FieldLogger) Interface
New returns a new reconcile scheduler interface.
type Reason ¶
type Reason struct {
// contains filtered or unexported fields
}
Reason is a structure type that contains a reason code as well as a message. It is returned to users' requests in order to explain the made decision.
Click to show internal directories.
Click to hide internal directories.