Documentation
¶
Index ¶
- Constants
- Variables
- func Equals(refA, refB *v1.ObjectReference) bool
- func GetRequests(kind string, a handler.MapObject) []reconcile.Request
- func Handler(owner interface{}) handler.EventHandler
- func Label(object v1.Object) (label, uid string)
- func Labels(object v1.Object) map[string]string
- func RefSet(ref *v1.ObjectReference) bool
- func ToKind(resource interface{}) string
- type EventMapper
- type Owner
- type RefMap
- type Target
Constants ¶
View Source
const (
// = Application
PartOfLabel = "app.kubernetes.io/part-of"
)
Labels
View Source
const (
Tag = "ref"
)
Variables ¶
View Source
var ( // Application identifier included in reference labels. // **Must set be by the using application. Application = "" )
Functions ¶
func Equals ¶
func Equals(refA, refB *v1.ObjectReference) bool
Equals comparison. May be used with `nil` pointers.
func GetRequests ¶
Impl the handler interface.
func Handler ¶
func Handler(owner interface{}) handler.EventHandler
Build an event handler. Example:
err = cnt.Watch( &source.Kind{ Type: &api.Referenced{}, }, libref.Handler(&api.Owner{}))
func RefSet ¶
func RefSet(ref *v1.ObjectReference) bool
Determine if the ref is `set`. Must not be `nil` with Namespace and Name not "".
Types ¶
type EventMapper ¶
type EventMapper struct {
Map *RefMap
}
Predicate Event Mapper All ObjectReference fields with the `ref` tag will be mapped.
Example (CRD):
type Resource struct { ThingRef *v1.ObjectReference `json:"thingRef" ref:"Thing"` }
Example (usage):
func (p Predicate) Create(e event.CreateEvent) bool { ... ref.Mapper.Create(e) }}
var Mapper *EventMapper
type RefMap ¶
A 1-n mapping of Target => [Owner, ...].
var Map *RefMap
Global
func (*RefMap) DeleteOwner ¶
Delete all mappings to an owner.
Click to show internal directories.
Click to hide internal directories.