{"modulePath":"github.com/sub-mod/kubernetes","version":"v0.4.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\nPackage errors provides detailed error types for api field validation.\n\n## Functions\n\n```go\nfunc FromObject(obj runtime.Object) error\n```\nFromObject generates an statusError from an api.Status, if that is the type of obj; otherwise, returns an error created by fmt.Errorf.\n\n```go\nfunc IsAlreadyExists(err error) bool\n```\nIsAlreadyExists determines if the err is an error which indicates that a specified resource already exists.\n\n```go\nfunc IsConflict(err error) bool\n```\nIsConflict determines if the err is an error which indicates the provided update conflicts.\n\n```go\nfunc IsInvalid(err error) bool\n```\nIsInvalid determines if the err is an error which indicates the provided resource is not valid.\n\n```go\nfunc IsNotFound(err error) bool\n```\nIsNotFound returns true if the specified error was created by NewNotFoundErr.\n\n```go\nfunc NewAlreadyExists(kind, name string) error\n```\nNewAlreadyExists returns an error indicating the item requested exists by that identifier.\n\n```go\nfunc NewConflict(kind, name string, err error) error\n```\nNewConflict returns an error indicating the item can't be updated as provided.\n\n```go\nfunc NewInvalid(kind, name string, errs ErrorList) error\n```\nNewInvalid returns an error indicating the item is invalid and cannot be processed.\n\n```go\nfunc NewNotFound(kind, name string) error\n```\nNewNotFound returns a new error which indicates that the resource of the kind and the name was not found.\n\n```go\nfunc ValueOf(t ValidationErrorType) string\n```\n\n## Types\n\n```go\ntype ErrorList util.ErrorList\n```\nErrorList is a collection of errors.  This does not implement the error interface to avoid confusion where an empty ErrorList would still be an error (non-nil).  To produce a single error instance from an ErrorList, use the ToError() method, which will return nil for an empty ErrorList.\n\n```go\nfunc (list ErrorList) Prefix(prefix string) ErrorList\n```\nPrefix adds a prefix to the Field of every ValidationError in the list. Returns the list for convenience.\n\n```go\nfunc (list ErrorList) PrefixIndex(index int) ErrorList\n```\nPrefixIndex adds an index to the Field of every ValidationError in the list. Returns the list for convenience.\n\n```go\nfunc (list ErrorList) ToError() error\n```\nToError converts an ErrorList into a \"normal\" error, or nil if the list is empty.\n\n```go\ntype ValidationError struct {\n\tType     ValidationErrorType\n\tField    string\n\tBadValue interface{}\n}\n```\nValidationError is an implementation of the 'error' interface, which represents an error of validation.\n\n```go\nfunc NewFieldDuplicate(field string, value interface{}) ValidationError\n```\nNewFieldDuplicate returns a ValidationError indicating \"duplicate value\"\n\n```go\nfunc NewFieldInvalid(field string, value interface{}) ValidationError\n```\nNewFieldInvalid returns a ValidationError indicating \"invalid value\"\n\n```go\nfunc NewFieldNotFound(field string, value interface{}) ValidationError\n```\nNewFieldNotFound returns a ValidationError indicating \"value not found\"\n\n```go\nfunc NewFieldNotSupported(field string, value interface{}) ValidationError\n```\nNewFieldNotSupported returns a ValidationError indicating \"unsupported value\"\n\n```go\nfunc NewFieldRequired(field string, value interface{}) ValidationError\n```\nNewFieldRequired returns a ValidationError indicating \"value required\"\n\n```go\nfunc (v ValidationError) Error() string\n```\n\n```go\ntype ValidationErrorType string\n```\nValidationErrorType is a machine readable value providing more detail about why a field is invalid.  These values are expected to match 1-1 with CauseType in api/types.go.\n\n```go\nconst (\n\t// ValidationErrorTypeNotFound is used to report failure to find a requested value\n\t// (e.g. looking up an ID).\n\tValidationErrorTypeNotFound ValidationErrorType = \"FieldValueNotFound\"\n\t// ValidationErrorTypeRequired is used to report required values that are not\n\t// provided (e.g. empty strings, null values, or empty arrays).\n\tValidationErrorTypeRequired ValidationErrorType = \"FieldValueRequired\"\n\t// ValidationErrorTypeDuplicate is used to report collisions of values that must be\n\t// unique (e.g. unique IDs).\n\tValidationErrorTypeDuplicate ValidationErrorType = \"FieldValueDuplicate\"\n\t// ValidationErrorTypeInvalid is used to report malformed values (e.g. failed regex\n\t// match).\n\tValidationErrorTypeInvalid ValidationErrorType = \"FieldValueInvalid\"\n\t// ValidationErrorTypeNotSupported is used to report valid (as per formatting rules)\n\t// values that can not be handled (e.g. an enumerated string).\n\tValidationErrorTypeNotSupported ValidationErrorType = \"FieldValueNotSupported\"\n)\n```\nTODO: These values are duplicated in api/types.go, but there's a circular dep.  Fix it.\n\n","path":"github.com/sub-mod/kubernetes/pkg/api/errors","name":"errors","synopsis":"Package errors provides detailed error types for api field validation.","isRedistributable":true}
