definition

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

type Definition struct {
	Digest         artifactstore.Digest         `json:"digest"`
	Kind           artifactstore.ArtifactKind   `json:"kind"`
	SchemaID       artifactstore.SchemaID       `json:"schemaID"`
	SchemaVersion  string                       `json:"schemaVersion"`
	LogicalName    artifactstore.LogicalName    `json:"logicalName"`
	LogicalVersion artifactstore.LogicalVersion `json:"logicalVersion,omitempty"`
	DisplayName    string                       `json:"displayName,omitempty"`
	Description    string                       `json:"description,omitempty"`
	Labels         map[string]string            `json:"labels,omitempty"`
	Body           json.RawMessage              `json:"body"`
	Dependencies   []Selector                   `json:"dependencies,omitempty"`
}

func Canonicalize

func Canonicalize(input Definition) (Definition, error)

func ReadCanonical

func ReadCanonical(
	ctx context.Context,
	reader Reader,
	digest artifactstore.Digest,
) (Definition, error)

ReadCanonical reads a definition through a Reader and establishes the ownership and integrity guarantees required by consumers.

The returned definition is canonical, independently owned, valid, and has the digest requested by the caller.

func (Definition) Validate

func (d Definition) Validate() error

type Reader

type Reader interface {
	Get(
		ctx context.Context,
		digest artifactstore.Digest,
	) (Definition, error)
}

type Repository

type Repository interface {
	Reader
	Writer
}

type Selector

type Selector struct {
	Kind              artifactstore.ArtifactKind `json:"kind"`
	LogicalName       artifactstore.LogicalName  `json:"logicalName,omitempty"`
	VersionConstraint string                     `json:"versionConstraint,omitempty"`
	Labels            map[string]string          `json:"labels,omitempty"`
}

func (Selector) Validate

func (s Selector) Validate() error

type Writer

type Writer interface {
	Put(
		ctx context.Context,
		value Definition,
	) (Definition, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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