Add easy setup for simple controller

Also add tests; coverage up to 86.7%
This commit is contained in:
Daniel Smith
2015-04-07 16:00:37 -07:00
parent 065a8fa454
commit 880f922bb6
4 changed files with 433 additions and 7 deletions

View File

@@ -59,6 +59,10 @@ func (k KeyError) Error() string {
return fmt.Sprintf("couldn't create key for object %+v: %v", k.Obj, k.Err)
}
// ExplicitKey can be passed to MetaNamespaceKeyFunc if you have the key for
// the object but not the object itself.
type ExplicitKey string
// MetaNamespaceKeyFunc is a convenient default KeyFunc which knows how to make
// keys for API objects which implement meta.Interface.
// The key uses the format <namespace>/<name> unless <namespace> is empty, then