registry

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 14 Imported by: 0

Documentation

Overview

Package registry provides storage for CLIP image archives.

Index

Constants

View Source
const (
	// FileExtension is the extension used for CLIP archive files
	FileExtension = "clip"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Bucket         string
	Region         string
	Endpoint       string
	AccessKey      string
	SecretKey      string
	ForcePathStyle bool
}

Config holds the configuration for the image registry.

type ImageRegistry

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

ImageRegistry manages CLIP archive storage in S3.

func NewImageRegistry

func NewImageRegistry(cfg Config) (*ImageRegistry, error)

NewImageRegistry creates a new image registry with S3 storage.

func (*ImageRegistry) Exists

func (r *ImageRegistry) Exists(ctx context.Context, imageID string) (bool, error)

Exists checks if a CLIP archive exists in the registry.

func (*ImageRegistry) Pull

func (r *ImageRegistry) Pull(ctx context.Context, localPath, imageID string) error

Pull downloads a CLIP archive from the registry.

func (*ImageRegistry) Push

func (r *ImageRegistry) Push(ctx context.Context, localPath, imageID string) error

Push uploads a CLIP archive to the registry.

type ObjectStore

type ObjectStore interface {
	Put(ctx context.Context, localPath, key string) error
	Get(ctx context.Context, key, localPath string) error
	Exists(ctx context.Context, key string) (bool, error)
}

ObjectStore defines the interface for object storage backends.

type S3Store

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

S3Store implements ObjectStore using AWS S3.

func NewS3Store

func NewS3Store(cfg Config) (*S3Store, error)

NewS3Store creates a new S3-backed object store.

func (*S3Store) Exists

func (s *S3Store) Exists(ctx context.Context, key string) (bool, error)

Exists checks if an object exists in S3.

func (*S3Store) Get

func (s *S3Store) Get(ctx context.Context, key, localPath string) error

Get downloads a file from S3.

func (*S3Store) Put

func (s *S3Store) Put(ctx context.Context, localPath, key string) error

Put uploads a file to S3.

Jump to

Keyboard shortcuts

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