mirror of https://github.com/knative/pkg.git
Add the Convertible interface. (#369)
This sketches the "Convertible" interface that @vagababov outlined in last week's Serving API WG meeting. See also: https://docs.google.com/document/d/1UFUfwIF4q4r6JVigom0jQivbcI8mFycWPc9z48yjSIc/edit#heading=h.9np2by1b65b
This commit is contained in:
parent
4993c57ea3
commit
42e08a4657
|
@ -35,6 +35,16 @@ type Validatable interface {
|
|||
Validate(context.Context) *FieldError
|
||||
}
|
||||
|
||||
// Convertible indicates that a particular type supports conversions to/from
|
||||
// "higher" versions of the same type.
|
||||
type Convertible interface {
|
||||
// ConvertUp up-converts the receiver into `to`.
|
||||
ConvertUp(to Convertible) error
|
||||
|
||||
// ConvertDown down-converts from `from` into the receiver.
|
||||
ConvertDown(from Convertible) error
|
||||
}
|
||||
|
||||
// Immutable indicates that a particular type has fields that should
|
||||
// not change after creation.
|
||||
type Immutable interface {
|
||||
|
|
Loading…
Reference in New Issue