artefacts

package
v0.406.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artefact

type Artefact struct {
	Digest   sha256.SHA256
	Metadata Metadata
	Content  []byte
}

Artefact container for an artefact's payload and metadata

type ArtefactBlobs added in v0.389.0

type ArtefactBlobs struct {
	Digest    sha256.SHA256
	MediaType string
	Size      int64
}

type ArtefactKey

type ArtefactKey struct {
	Digest sha256.SHA256
}

type ArtefactRepository added in v0.379.0

type ArtefactRepository struct {
	ModuleDigest     sha256.SHA256
	MediaType        string
	ArtefactType     string
	RepositoryDigest digest.Digest
	Size             int64
}

type Metadata

type Metadata struct {
	Executable bool
	Path       string
}

Metadata container for an artefact's metadata

type OCIArtefactService added in v0.397.1

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

func NewForTesting added in v0.397.1

func NewForTesting() *OCIArtefactService

func NewOCIRegistryStorage added in v0.397.1

func NewOCIRegistryStorage(c RegistryConfig) (*OCIArtefactService, error)

func (*OCIArtefactService) Download added in v0.397.1

func (*OCIArtefactService) GetDigestsKeys added in v0.397.1

func (s *OCIArtefactService) GetDigestsKeys(ctx context.Context, digests []sha256.SHA256) (keys []ArtefactKey, missing []sha256.SHA256, err error)

func (*OCIArtefactService) Upload added in v0.397.1

func (s *OCIArtefactService) Upload(ctx context.Context, artefact Artefact) (sha256.SHA256, error)

Upload uploads the specific artifact as a raw blob and links it to a manifest to prevent GC

type RegistryConfig added in v0.397.1

type RegistryConfig struct {
	Registry      string `help:"OCI container registry, in the form host[:port]/repository" env:"FTL_ARTEFACT_REGISTRY" required:""`
	Username      string `help:"OCI container registry username" env:"FTL_ARTEFACT_REGISTRY_USERNAME"`
	Password      string `help:"OCI container registry password" env:"FTL_ARTEFACT_REGISTRY_PASSWORD"`
	AllowInsecure bool   `help:"Allows the use of insecure HTTP based registries." env:"FTL_ARTEFACT_REGISTRY_ALLOW_INSECURE"`
}

type ReleaseArtefact

type ReleaseArtefact struct {
	Artefact   ArtefactKey
	Path       string
	Executable bool
}

type Service

type Service interface {

	// GetDigestsKeys locates the `digests` corresponding `ArtefactKey`s and identifies the missing ones
	GetDigestsKeys(ctx context.Context, digests []sha256.SHA256) (keys []ArtefactKey, missing []sha256.SHA256, err error)

	// Upload pushes the specified media, and metadata, to the registry and returns the computed digest
	Upload(context context.Context, artefact Artefact) (sha256.SHA256, error)

	// Download performs a streaming download of the artefact identified by the supplied digest
	Download(context context.Context, digest sha256.SHA256) (io.ReadCloser, error)
}

Jump to

Keyboard shortcuts

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