Documentation ¶
Overview ¶
+k8s:deepcopy-gen=package
Index ¶
- Constants
- func KindToResource(gvk schema.GroupVersionKind) schema.GroupVersionResource
- type Defaultable
- type FieldError
- func ErrDisallowedFields(fieldPaths ...string) *FieldError
- func ErrInvalidKeyName(value, fieldPath string, details ...string) *FieldError
- func ErrInvalidValue(value, fieldPath string) *FieldError
- func ErrMissingField(fieldPaths ...string) *FieldError
- func ErrMissingOneOf(fieldPaths ...string) *FieldError
- func ErrMultipleOneOf(fieldPaths ...string) *FieldError
- func ErrOutOfBoundsValue(value, lower, upper, fieldPath string) *FieldError
- func (fe *FieldError) Also(errs ...*FieldError) *FieldError
- func (in *FieldError) DeepCopy() *FieldError
- func (in *FieldError) DeepCopyInto(out *FieldError)
- func (fe *FieldError) Error() string
- func (fe *FieldError) ViaField(prefix ...string) *FieldError
- func (fe *FieldError) ViaFieldIndex(field string, index int) *FieldError
- func (fe *FieldError) ViaFieldKey(field string, key string) *FieldError
- func (fe *FieldError) ViaIndex(index int) *FieldError
- func (fe *FieldError) ViaKey(key string) *FieldError
- type Immutable
- type Listable
- type Validatable
- type VolatileTime
Constants ¶
const CurrentField = ""
CurrentField is a constant to supply as a fieldPath for when there is a problem with the current field itself.
Variables ¶
This section is empty.
Functions ¶
func KindToResource ¶
func KindToResource(gvk schema.GroupVersionKind) schema.GroupVersionResource
KindToResource converts a GroupVersionKind to a GroupVersionResource through the world's simplest (worst) pluralizer.
Types ¶
type Defaultable ¶
type Defaultable interface {
SetDefaults()
}
Defaultable defines an interface for setting the defaults for the uninitialized fields of this instance.
type FieldError ¶
type FieldError struct { Message string Paths []string // Details contains an optional longer payload. // +optional Details string // contains filtered or unexported fields }
FieldError is used to propagate the context of errors pertaining to specific fields in a manner suitable for use in a recursive walk, so that errors contain the appropriate field context. FieldError methods are non-mutating. +k8s:deepcopy-gen=true
func ErrDisallowedFields ¶
func ErrDisallowedFields(fieldPaths ...string) *FieldError
ErrDisallowedFields is a variadic helper method for constructing a FieldError for a set of disallowed fields.
func ErrInvalidKeyName ¶
func ErrInvalidKeyName(value, fieldPath string, details ...string) *FieldError
ErrInvalidKeyName is a variadic helper method for constructing a FieldError that specifies a key name that is invalid.
func ErrInvalidValue ¶
func ErrInvalidValue(value, fieldPath string) *FieldError
ErrInvalidValue constructs a FieldError for a field that has received an invalid string value.
func ErrMissingField ¶
func ErrMissingField(fieldPaths ...string) *FieldError
ErrMissingField is a variadic helper method for constructing a FieldError for a set of missing fields.
func ErrMissingOneOf ¶
func ErrMissingOneOf(fieldPaths ...string) *FieldError
ErrMissingOneOf is a variadic helper method for constructing a FieldError for not having at least one field in a mutually exclusive field group.
func ErrMultipleOneOf ¶
func ErrMultipleOneOf(fieldPaths ...string) *FieldError
ErrMultipleOneOf is a variadic helper method for constructing a FieldError for having more than one field set in a mutually exclusive field group.
func ErrOutOfBoundsValue ¶
func ErrOutOfBoundsValue(value, lower, upper, fieldPath string) *FieldError
ErrOutOfBoundsValue constructs a FieldError for a field that has received an out of bound value.
func (*FieldError) Also ¶
func (fe *FieldError) Also(errs ...*FieldError) *FieldError
Also collects errors, returns a new collection of existing errors and new errors.
func (*FieldError) DeepCopy ¶
func (in *FieldError) DeepCopy() *FieldError
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FieldError.
func (*FieldError) DeepCopyInto ¶
func (in *FieldError) DeepCopyInto(out *FieldError)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*FieldError) ViaField ¶
func (fe *FieldError) ViaField(prefix ...string) *FieldError
ViaField is used to propagate a validation error along a field access. For example, if a type recursively validates its "spec" via:
if err := foo.Spec.Validate(); err != nil { // Augment any field paths with the context that they were accessed // via "spec". return err.ViaField("spec") }
func (*FieldError) ViaFieldIndex ¶
func (fe *FieldError) ViaFieldIndex(field string, index int) *FieldError
ViaFieldIndex is the short way to chain: err.ViaIndex(bar).ViaField(foo)
func (*FieldError) ViaFieldKey ¶
func (fe *FieldError) ViaFieldKey(field string, key string) *FieldError
ViaFieldKey is the short way to chain: err.ViaKey(bar).ViaField(foo)
func (*FieldError) ViaIndex ¶
func (fe *FieldError) ViaIndex(index int) *FieldError
ViaIndex is used to attach an index to the next ViaField provided. For example, if a type recursively validates a parameter that has a collection:
for i, c := range spec.Collection { if err := doValidation(c); err != nil { return err.ViaIndex(i).ViaField("collection") } }
func (*FieldError) ViaKey ¶
func (fe *FieldError) ViaKey(key string) *FieldError
ViaKey is used to attach a key to the next ViaField provided. For example, if a type recursively validates a parameter that has a collection:
for k, v := range spec.Bag. { if err := doValidation(v); err != nil { return err.ViaKey(k).ViaField("bag") } }
type Immutable ¶
type Immutable interface { // CheckImmutableFields checks that the current instance's immutable // fields haven't changed from the provided original. CheckImmutableFields(original Immutable) *FieldError }
Immutable indicates that a particular type has fields that should not change after creation.
type Listable ¶
Listable indicates that a particular type can be returned via the returned list type by the API server.
type Validatable ¶
type Validatable interface { // Validate checks the validity of this types fields. Validate() *FieldError }
Validatable indicates that a particular type may have its fields validated.
type VolatileTime ¶
VolatileTime wraps metav1.Time
func (*VolatileTime) DeepCopy ¶
func (in *VolatileTime) DeepCopy() *VolatileTime
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolatileTime.
func (*VolatileTime) DeepCopyInto ¶
func (in *VolatileTime) DeepCopyInto(out *VolatileTime)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (VolatileTime) MarshalJSON ¶
func (t VolatileTime) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*VolatileTime) UnmarshalJSON ¶
func (t *VolatileTime) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller interface.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package duck defines logic for defining and consuming "duck typed" Kubernetes resources.
|
Package duck defines logic for defining and consuming "duck typed" Kubernetes resources. |
v1alpha1
+k8s:deepcopy-gen=package +groupName=duck.knative.dev
|
+k8s:deepcopy-gen=package +groupName=duck.knative.dev |
authentication/v1alpha1
Api versions allow the api contract for a resource to be changed while keeping backward compatibility by support multiple concurrent versions of the same resource +k8s:deepcopy-gen=package +groupName=authentication.istio.io
|
Api versions allow the api contract for a resource to be changed while keeping backward compatibility by support multiple concurrent versions of the same resource +k8s:deepcopy-gen=package +groupName=authentication.istio.io |
v1alpha3
+k8s:deepcopy-gen=package +groupName=networking.istio.io
|
+k8s:deepcopy-gen=package +groupName=networking.istio.io |