storage

package
v0.0.0-...-10b4495 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBackend

func RegisterBackend(backendName string, factory BackendFactory)

RegisterBackend can be used to register a new storage backend in order to be available.

Types

type Backend

type Backend interface {
	// Init initialize the storage backend with the docker client (SDK).
	Init(dockerClient *dockerClient.Client)

	// Load loads the image inside the docker engine and returns the image key assigned inside the docker engine.
	LoadImage(imageKey string) (string, error)
}

Backend interface for container's images storage backends.

func CreateBackend

func CreateBackend(config *configuration.Configuration) Backend

CreateBackend is used to obtain a storage backend based on the configurations.

type BackendFactory

type BackendFactory func() (Backend, error)

BackendFactory represents a method that creates a new image storage backend.

type BaseBackend

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

BaseBackend is a base for all the storage backends.

type DockerHubBackend

type DockerHubBackend struct {
	BaseBackend
}

DockerHubBackend represents a image storage backup that uses the Docker public registry to store and retrieve images to run in CARAVELA.

func (*DockerHubBackend) Init

func (dockerHub *DockerHubBackend) Init(dockerClient *dockerClient.Client)

func (*DockerHubBackend) LoadImage

func (dockerHub *DockerHubBackend) LoadImage(imageKey string) (string, error)

type IPFSBackend

type IPFSBackend struct {
	BaseBackend
}

IPFSBackend is a backend implemented on top of the highly distributed IPFS file system.

func (*IPFSBackend) Init

func (ipfs *IPFSBackend) Init(dockerClient *dockerClient.Client)

func (*IPFSBackend) LoadImage

func (ipfs *IPFSBackend) LoadImage(imageKey string) (string, error)

Jump to

Keyboard shortcuts

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