schematic

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package schematic implements schematic factory: storing image schematics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

Factory is the schematic factory.

func NewFactory

func NewFactory(logger *zap.Logger, storage storage.Storage, options Options) *Factory

NewFactory creates a new schematic factory.

func (*Factory) Collect

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

Collect implements prom.Collector interface.

func (*Factory) Describe

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

Describe implements prom.Collector interface.

func (*Factory) Get

Get retrieves the stored schematic and enforces ownership.

If auth is non-nil and the caller is unauthenticated, RequiresAuthenticationTag is returned even when the schematic is not found, to avoid leaking schematic existence to anonymous callers.

func (*Factory) Put

func (s *Factory) Put(ctx context.Context, cfg *schematic.Schematic) (string, error)

Put stores the schematic.

If the schematic already exists, Put does nothing.

type Options

type Options struct {
	MetricsNamespace string
}

Options for the schematic factory.

type OwnershipChecker added in v1.2.0

type OwnershipChecker interface {
	UsernameFromContext(ctx context.Context) (string, bool)
}

OwnershipChecker resolves the authenticated user from a context.

Directories

Path Synopsis
Package storage implements a storage for schematic data.
Package storage implements a storage for schematic data.
cache
Package cache implements an in-memory cache over schematic storage.
Package cache implements an in-memory cache over schematic storage.
registry
Package registry implements a schematic storage in OCI registry.
Package registry implements a schematic storage in OCI registry.

Jump to

Keyboard shortcuts

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