schematic

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MPL-2.0 Imports: 11 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 through the application ownership policy.

Application callers should prefer Service.Get. This compatibility facade adapts legacy authentication-provider contexts into a typed principal before delegating to Service.

func (*Factory) GetRaw added in v1.7.2

func (s *Factory) GetRaw(ctx context.Context, id string) (*schematic.Schematic, error)

GetRaw retrieves a stored schematic without applying authorization policy.

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.

type Repository added in v1.7.2

type Repository interface {
	Put(ctx context.Context, configuration *schematicpkg.Schematic) (string, error)
	GetRaw(ctx context.Context, id string) (*schematicpkg.Schematic, error)
}

Repository stores and retrieves raw schematics.

type Service added in v1.7.2

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

Service owns schematic validation, ownership, and persistence orchestration.

func NewService added in v1.7.2

func NewService(repository Repository, authEnabled, enterpriseEnabled bool) *Service

NewService creates a schematic application service.

func (*Service) Create added in v1.7.2

func (service *Service) Create(ctx context.Context, configuration *schematicpkg.Schematic) (string, error)

Create validates and stores a schematic under the authenticated owner.

func (*Service) Get added in v1.7.2

func (service *Service) Get(ctx context.Context, id string) (*schematicpkg.Schematic, error)

Get retrieves a schematic and enforces the configured ownership policy.

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