Commit Graph

8 Commits

Author SHA1 Message Date
Markus Thömmes 565516e224
Add errorlint and fix all existing issues (#1855) 2020-10-29 01:14:35 -07:00
Alvaro Aleman 22502028e3
Avoid importing apis/duck from apis/duck/<<version>> (#1388) 2020-07-10 17:49:37 -07:00
Matt Moore 43ca049cdb Reduce the boilerplate for setting up duck.InformerFactory's. (#896)
This augments the injection codegen with the capability to produce a duck.InformerFactory
attached to context for each type that we process.

Now a `duck.InformerFactory` for "Addressable" can be produced by "Get"ing it from the context.

This is triggered by placing `// +genduck` on the type that implements `duck.Implementable`.
2019-11-25 09:57:10 -08:00
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -07:00
Dave Protasowski d6a2e27f7b 🦆 Duck Typing - add a ConformsToType helper (#220)
* duck typing - add a ConformsToType helper

Unlike VerifyType, ConformsToType will return the following:
- an error when any marshalling/unmarshalling fails
- false when the concrete type does not implement the duck type
- true when the concrete type implements the duck type

* use knative/pkg kmp to handle panics raised by go-cmp
2019-01-09 19:58:42 -08:00
Evan Anderson 82424e6283 Fix a typo in Implementable (#152) 2018-11-01 07:24:34 -07:00
Vincent Demeester 781d6bbc47 Move the use of `VerifyType` in tests (#98)
* Change VerifyType to return an error instead of panicking

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>

* Move the use of `VerifyType` in tests

Those calls to `duck.VerifyType` are done at runtime and thus could be
costly at program startup. Putting them under tests ensure we still
assert those types but during unit testing.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
2018-09-27 15:16:22 -07:00
Matt Moore 9a13caa7a1 WIP Define a package with which to support duck typed definitions. (#71)
This also sketches out the skeletons for Targettable, Subscribable, and Conditions.
2018-09-15 19:08:17 -07:00