apis

package
v0.0.0-...-9137930 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package

Index

Constants

View Source
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

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) Error

func (fe *FieldError) Error() string

Error implements error

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

type Listable interface {
	runtime.Object

	GetListType() runtime.Object
}

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

type VolatileTime struct {
	Inner metav1.Time
}

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.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL