{"modulePath":"github.com/dockerstack/kubernetes","version":"v0.20.1-0.20150627061651-1c0b765df6da","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package fielderrors\n\n## Functions\n\n```go\nfunc NewValidationErrorFieldPrefixMatcher(prefix string) errors.Matcher\n```\nNewValidationErrorFieldPrefixMatcher returns an errors.Matcher that returns true if the provided error is a ValidationError and has a field with the provided prefix.\n\n```go\nfunc NewValidationErrorTypeMatcher(t ValidationErrorType) errors.Matcher\n```\nNewValidationErrorFieldPrefixMatcher returns an errors.Matcher that returns true if the provided error is a ValidationError and has the provided ValidationErrorType.\n\n## Types\n\n```go\ntype ValidationError struct {\n\tType     ValidationErrorType\n\tField    string\n\tBadValue interface{}\n\tDetail   string\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 NewFieldForbidden(field string, value interface{}) *ValidationError\n```\nNewFieldForbidden returns a \\*ValidationError indicating \"forbidden\"\n\n```go\nfunc NewFieldInvalid(field string, value interface{}, detail string) *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 NewFieldRequired(field string) *ValidationError\n```\nNewFieldRequired returns a \\*ValidationError indicating \"value required\"\n\n```go\nfunc NewFieldTooLong(field string, value interface{}, maxLength int) *ValidationError\n```\n\n```go\nfunc NewFieldValueNotSupported(field string, value interface{}, validValues []string) *ValidationError\n```\nNewFieldValueNotSupported returns a \\*ValidationError indicating \"unsupported value\"\n\n```go\nfunc (v *ValidationError) Error() string\n```\n\n```go\ntype ValidationErrorList []error\n```\n\n```go\nfunc (list ValidationErrorList) Filter(fns ...errors.Matcher) ValidationErrorList\n```\nFilter removes items from the ValidationErrorList that match the provided fns.\n\n```go\nfunc (list ValidationErrorList) Prefix(prefix string) ValidationErrorList\n```\nPrefix adds a prefix to the Field of every ValidationError in the list. Returns the list for convenience.\n\n```go\nfunc (list ValidationErrorList) PrefixIndex(index int) ValidationErrorList\n```\nPrefixIndex adds an index to the Field of every ValidationError in the list. Returns the list for convenience.\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\t// ValidationErrorTypeForbidden is used to report valid (as per formatting rules)\n\t// values which would be accepted by some api instances, but which would invoke behavior\n\t// not permitted by this api instance (such as due to stricter security policy).\n\tValidationErrorTypeForbidden ValidationErrorType = \"FieldValueForbidden\"\n\t// ValidationErrorTypeTooLong is used to report that given value is too long.\n\tValidationErrorTypeTooLong ValidationErrorType = \"FieldValueTooLong\"\n)\n```\nTODO: These values are duplicated in api/types.go, but there's a circular dep.  Fix it.\n\n```go\nfunc (t ValidationErrorType) String() string\n```\nString converts a ValidationErrorType into its corresponding error message.\n\n","path":"github.com/dockerstack/kubernetes/pkg/util/fielderrors","name":"fielderrors","synopsis":"","isRedistributable":true}
