shareable

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canonicalizer

type Canonicalizer interface {
	Canonicalize(
		ctx context.Context,
		raw []byte,
	) (ParsedDocument, error)
}

Canonicalizer is the narrow validation capability needed by artifact-family hydration and linked-source descriptor readers.

type Codec

type Codec interface {
	Key() SchemaKey
	JSONSchema() []byte

	// Canonicalize strictly decodes, validates, calculates or verifies the
	// optional supplied digest, and returns canonical JSON containing the
	// calculated digest. It does not persist source content.
	Canonicalize(
		ctx context.Context,
		raw []byte,
	) (ParsedDocument, error)
}

type EntityType

type EntityType string
const EntityCollection EntityType = "collection"

type ParsedDocument

type ParsedDocument struct {
	Key    SchemaKey
	Digest cryptoutil.Digest
	Raw    json.RawMessage
}

func (ParsedDocument) Clone

func (d ParsedDocument) Clone() ParsedDocument

func (ParsedDocument) Validate

func (d ParsedDocument) Validate() error

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(codecs ...Codec) (*Registry, error)

func (*Registry) Canonicalize

func (r *Registry) Canonicalize(
	ctx context.Context,
	raw []byte,
) (ParsedDocument, error)

func (*Registry) Keys

func (r *Registry) Keys() []SchemaKey

type SchemaKey

type SchemaKey struct {
	Entity        EntityType              `json:"entity"`
	Kind          basespec.CollectionKind `json:"kind"`
	SchemaID      basespec.SchemaID       `json:"schemaID"`
	SchemaVersion string                  `json:"schemaVersion"`
}

func (SchemaKey) Validate

func (k SchemaKey) Validate() error

Jump to

Keyboard shortcuts

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