image

package
v0.0.0-...-15beef2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPlatformImageNotFound = errors.New("Platform image not found")
)

Functions

This section is empty.

Types

type ImageRegistry

type ImageRegistry string
const EmptyImageRegistry ImageRegistry = ""

type MockPlatformImageService

type MockPlatformImageService struct {
	OnNewVersion          func(string) (int, error)
	OnNewImage            func(ImageRegistry, string, int) (string, error)
	OnCurrentImage        func(ImageRegistry, string) (string, error)
	OnAppendImages        func(string, int, []string) error
	OnDeleteImages        func(string) error
	OnListImages          func(string) ([]string, error)
	OnListImagesOrDefault func(string) ([]string, error)
	OnFindImage           func(ImageRegistry, string, string) (string, error)
}

MockPlatformImageService implements PlatformImageService interface

func (*MockPlatformImageService) AppendImages

func (m *MockPlatformImageService) AppendImages(ctx context.Context, platformName string, version int, imageID []string) error

func (*MockPlatformImageService) CurrentImage

func (m *MockPlatformImageService) CurrentImage(ctx context.Context, reg ImageRegistry, platformName string) (string, error)

func (*MockPlatformImageService) DeleteImages

func (m *MockPlatformImageService) DeleteImages(ctx context.Context, platformName string) error

func (*MockPlatformImageService) FindImage

func (m *MockPlatformImageService) FindImage(ctx context.Context, reg ImageRegistry, platformName, image string) (string, error)

func (*MockPlatformImageService) ListImages

func (m *MockPlatformImageService) ListImages(ctx context.Context, platformName string) ([]string, error)

func (*MockPlatformImageService) ListImagesOrDefault

func (m *MockPlatformImageService) ListImagesOrDefault(ctx context.Context, platformName string) ([]string, error)

func (*MockPlatformImageService) NewImage

func (m *MockPlatformImageService) NewImage(ctx context.Context, reg ImageRegistry, platformName string, version int) (string, error)

func (*MockPlatformImageService) NewVersion

func (m *MockPlatformImageService) NewVersion(ctx context.Context, platformName string) (int, error)

type MockPlatformImageStorage

type MockPlatformImageStorage struct {
	OnUpsert     func(string) (*PlatformImage, error)
	OnFindByName func(string) (*PlatformImage, error)
	OnAppend     func(string, int, []string) error
	OnDelete     func(string) error
}

MockPlatformStorage implements PlatformStorage interface

func (*MockPlatformImageStorage) Append

func (m *MockPlatformImageStorage) Append(ctx context.Context, name string, version int, images []string) error

func (*MockPlatformImageStorage) Delete

func (m *MockPlatformImageStorage) Delete(ctx context.Context, name string) error

func (*MockPlatformImageStorage) FindByName

func (m *MockPlatformImageStorage) FindByName(ctx context.Context, name string) (*PlatformImage, error)

func (*MockPlatformImageStorage) Upsert

type PlatformImage

type PlatformImage struct {
	Name     string
	Versions []RegistryVersion
	Count    int
}

type PlatformImageService

type PlatformImageService interface {
	NewVersion(context.Context, string) (int, error)
	NewImage(context.Context, ImageRegistry, string, int) (string, error)
	CurrentImage(context.Context, ImageRegistry, string) (string, error)
	AppendImages(context.Context, string, int, []string) error
	DeleteImages(context.Context, string) error
	ListImages(context.Context, string) ([]string, error)
	ListImagesOrDefault(context.Context, string) ([]string, error)
	FindImage(context.Context, ImageRegistry, string, string) (string, error)
}

type PlatformImageStorage

type PlatformImageStorage interface {
	Upsert(context.Context, string) (*PlatformImage, error)
	FindByName(context.Context, string) (*PlatformImage, error)
	Append(context.Context, string, int, []string) error
	Delete(context.Context, string) error
}

type RegistryVersion

type RegistryVersion struct {
	Version int
	Images  []string
}

Jump to

Keyboard shortcuts

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