registry

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package registry implements a schematic storage in OCI registry.

Index

Constants

View Source
const SchematicMediaType types.MediaType = "application/vnd.sidero.dev-image.schematic"

SchematicMediaType is a media type for the schematic stored in the OCI registry.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage is a schematic storage in a OCI Registry.

Schematic ID is a sha256 of the contents, so it matches registry content-addressable storage.

func NewStorage

func NewStorage(repository name.Repository, remoteOpts []remote.Option) (*Storage, error)

NewStorage creates a new storage.

func (*Storage) Collect

func (s *Storage) Collect(chan<- prometheus.Metric)

Collect implements prom.Collector interface.

func (*Storage) Describe

func (s *Storage) Describe(ch chan<- *prometheus.Desc)

Describe implements prom.Collector interface.

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, id string) ([]byte, error)

Get returns the schematic.

func (*Storage) Head

func (s *Storage) Head(ctx context.Context, id string) error

Head checks if the schematic exists.

func (*Storage) Put

func (s *Storage) Put(ctx context.Context, id string, data []byte) error

Put stores the schematic.

Jump to

Keyboard shortcuts

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