package model import ( "encoding/json" "io" "nf-repo/internal/model/types" ) type Manifest struct { Blob []byte `json:"blob"` ContentType string `json:"content_type"` } type Descriptor struct { MediaType types.MediaType `json:"mediaType"` Size int64 `json:"size"` Digest Hash `json:"digest"` Data []byte `json:"data,omitempty"` URLs []string `json:"urls,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` Platform *Platform `json:"platform,omitempty"` ArtifactType string `json:"artifactType,omitempty"` } type IndexManifest struct { SchemaVersion int64 `json:"schemaVersion"` MediaType types.MediaType `json:"mediaType,omitempty"` Manifests []Descriptor `json:"manifests"` Annotations map[string]string `json:"annotations,omitempty"` Subject *Descriptor `json:"subject,omitempty"` } func ParseIndexManifest(r io.Reader) (*IndexManifest, error) { im := IndexManifest{} if err := json.NewDecoder(r).Decode(&im); err != nil { return nil, err } return &im, nil }