package schema
import "github.com/opencontainers/image-spec/schema"
Package schema defines the OCI image media types, schema definitions and validation functions.
Index ¶
- Constants
- func FileSystem() http.FileSystem
- func WrapSyntaxError(r io.Reader, err error) error
- type SyntaxError
- type ValidationError
- type Validator
Constants ¶
const ( MediaTypeDescriptor Validator = `application/vnd.oci.descriptor.v1+json` MediaTypeManifest Validator = `application/vnd.oci.image.manifest.v1+json` MediaTypeManifestList Validator = `application/vnd.oci.image.manifest.list.v1+json` MediaTypeImageSerialization unimplemented = `application/vnd.oci.image.serialization.rootfs.tar.gzip` MediaTypeImageSerializationConfig Validator = `application/vnd.oci.image.serialization.config.v1+json` )
Media types for the OCI image formats
Functions ¶
func FileSystem ¶
func FileSystem() http.FileSystem
FileSystem returns an in-memory file system including the schema files. The schema files are located at the root directory.
func WrapSyntaxError ¶
WrapSyntaxError checks whether the given error is a *json.SyntaxError and converts it into a *schema.SyntaxError containing line/col information using the given reader. If the given error is not a *json.SyntaxError it is returned unchanged.
Types ¶
type SyntaxError ¶
A SyntaxError is a description of a JSON syntax error including line, column and offset in the JSON file.
func (*SyntaxError) Error ¶
func (e *SyntaxError) Error() string
type ValidationError ¶
type ValidationError struct { Errs []error }
ValidationError contains all the errors that happened during validation.
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type Validator ¶
type Validator string
Validator wraps a media type string identifier and implements validation against a JSON schema.
func (Validator) Validate ¶
Validate validates the given reader against the schema of the wrapped media type.
Source Files ¶
doc.go error.go fs.go gen.go schema.go validator.go
- Version
- v0.4.0
- Published
- Aug 10, 2016
- Platform
- js/wasm
- Imports
- 15 packages
- Last checked
- 2 hours ago –
Tools for package owners.