service

package
v0.0.0-...-0a271de Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service is a ResourceStore for container image resource types.

func NewService

func NewService(st State) *Service

func (Service) Get

func (s Service) Get(
	ctx context.Context,
	storageKey string,
) (r io.ReadCloser, size int64, err error)

Get returns an io.ReadCloser for a resource in the resource store.

func (Service) Put

func (s Service) Put(
	ctx context.Context,
	storageKey string,
	r io.Reader,
	_ int64,
	_ store.Fingerprint,
) (store.ID, error)

Put stores data from io.Reader in the resource store at the path specified in the resource. If an image is already stored under the storage key, it returns: - [containerimageresourcestoreerrors.ContainerImageMetadataAlreadyStored]

func (Service) Remove

func (s Service) Remove(
	ctx context.Context,
	storageKey string,
) error

Remove removes a resource from storage.

type State

type State interface {
	// RemoveContainerImageMetadata removes a container image resources metadata
	// from the container image metadata resource store.
	RemoveContainerImageMetadata(
		ctx context.Context,
		storageKey string,
	) error
	// PutContainerImageMetadata puts a container image resources metadata into
	// the container image metadata resource store.
	// If an image is already stored under the storage key, it returns:
	// - [containerimageresourcestoreerrors.ContainerImageMetadataAlreadyStored]
	PutContainerImageMetadata(
		ctx context.Context,
		storageKey string,
		registryPath, userName, password string,
	) (store.ID, error)
	// GetContainerImageMetadata gets a container image resources metadata from
	// the container image metadata resource store.
	GetContainerImageMetadata(
		ctx context.Context,
		storageKey string,
	) (containerimageresourcestore.ContainerImageMetadata, error)
}

State provides methods for interacting with the container image resource store.

Jump to

Keyboard shortcuts

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