api

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortOSImagesByName

func SortOSImagesByName(imgs []OS)

Types

type BootImage added in v0.1.2

type BootImage struct {
	SubPath string
	URL     string
	Size    int64
}

func (BootImage) Download added in v0.1.2

func (b BootImage) Download(ctx context.Context, target afero.File, c *http.Client, s3downloader *s3manager.Downloader) (int64, error)

func (BootImage) DownloadMD5 added in v0.1.2

func (b BootImage) DownloadMD5(ctx context.Context, target *afero.File, c *http.Client, s3downloader *s3manager.Downloader) (string, error)

func (BootImage) GetName added in v0.1.2

func (b BootImage) GetName() string

func (BootImage) GetSize added in v0.1.2

func (b BootImage) GetSize() int64

func (BootImage) GetSubPath added in v0.1.2

func (b BootImage) GetSubPath() string

func (BootImage) HasMD5 added in v0.1.2

func (b BootImage) HasMD5() bool

type CacheEntities added in v0.1.2

type CacheEntities []CacheEntity

type CacheEntity added in v0.1.2

type CacheEntity interface {
	GetName() string
	GetSubPath() string
	GetSize() int64
	HasMD5() bool
	DownloadMD5(ctx context.Context, target *afero.File, c *http.Client, s3downloader *s3manager.Downloader) (string, error)
	Download(ctx context.Context, target afero.File, c *http.Client, s3downloader *s3manager.Downloader) (int64, error)
}

type Config

type Config struct {
	CacheRootPath string `validate:"required"`

	KernelCacheEnabled    bool `validate:"required"`
	BootImageCacheEnabled bool `validate:"required"`

	ImageCacheBindAddress     string `validate:"required"`
	KernelCacheBindAddress    string
	BootImageCacheBindAddress string

	MetalAPIEndpoint string `validate:"required"`
	MetalAPIHMAC     string `validate:"required"`

	SyncSchedule string `validate:"required"`
	DryRun       bool
	ExcludePaths []string

	MinImagesPerName int   `validate:"required"`
	MaxImagesPerName int   `validate:"required"`
	MaxCacheSize     int64 `validate:"required"`

	ImageStore  string `validate:"required"`
	ImageBucket string `validate:"required"`

	ExpirationGraceDays uint
}

func NewConfig

func NewConfig() (*Config, error)

func (*Config) GetBootImageRootPath added in v0.1.2

func (c *Config) GetBootImageRootPath() string

func (*Config) GetImageRootPath added in v0.1.2

func (c *Config) GetImageRootPath() string

func (*Config) GetKernelRootPath added in v0.1.2

func (c *Config) GetKernelRootPath() string

func (*Config) GetTmpDownloadPath added in v0.1.2

func (c *Config) GetTmpDownloadPath() string

func (*Config) Validate

func (c *Config) Validate(fs afero.Fs) error

type Kernel added in v0.1.2

type Kernel struct {
	SubPath string
	URL     string
	Size    int64
}

func (Kernel) Download added in v0.1.2

func (k Kernel) Download(ctx context.Context, target afero.File, c *http.Client, s3downloader *s3manager.Downloader) (int64, error)

func (Kernel) DownloadMD5 added in v0.1.2

func (k Kernel) DownloadMD5(ctx context.Context, target *afero.File, c *http.Client, s3downloader *s3manager.Downloader) (string, error)

func (Kernel) GetName added in v0.1.2

func (k Kernel) GetName() string

func (Kernel) GetSize added in v0.1.2

func (k Kernel) GetSize() int64

func (Kernel) GetSubPath added in v0.1.2

func (k Kernel) GetSubPath() string

func (Kernel) HasMD5 added in v0.1.2

func (k Kernel) HasMD5() bool

type LocalFile added in v0.1.2

type LocalFile struct {
	Name    string
	SubPath string
	Size    int64
}

func (LocalFile) Download added in v0.1.2

func (l LocalFile) Download(ctx context.Context, target afero.File, c *http.Client, s3downloader *s3manager.Downloader) (int64, error)

func (LocalFile) DownloadMD5 added in v0.1.2

func (l LocalFile) DownloadMD5(ctx context.Context, target *afero.File, c *http.Client, s3downloader *s3manager.Downloader) (string, error)

func (LocalFile) GetName added in v0.1.2

func (l LocalFile) GetName() string

func (LocalFile) GetSize added in v0.1.2

func (l LocalFile) GetSize() int64

func (LocalFile) GetSubPath added in v0.1.2

func (l LocalFile) GetSubPath() string

func (LocalFile) HasMD5 added in v0.1.2

func (l LocalFile) HasMD5() bool

type OS

type OS struct {
	Name       string
	Version    *semver.Version
	ApiRef     models.V1ImageResponse
	ImageRef   s3.Object
	MD5Ref     s3.Object
	BucketKey  string
	BucketName string
}

func (OS) Download added in v0.1.2

func (o OS) Download(ctx context.Context, target afero.File, c *http.Client, s3downloader *s3manager.Downloader) (int64, error)

func (OS) DownloadMD5 added in v0.1.2

func (o OS) DownloadMD5(ctx context.Context, target *afero.File, c *http.Client, s3downloader *s3manager.Downloader) (string, error)

func (OS) GetName added in v0.1.2

func (o OS) GetName() string

func (OS) GetSize added in v0.1.2

func (o OS) GetSize() int64

func (OS) GetSubPath added in v0.1.2

func (o OS) GetSubPath() string

func (OS) HasMD5 added in v0.1.2

func (o OS) HasMD5() bool

func (*OS) MajorMinor

func (o *OS) MajorMinor() (string, error)

type OSImagesByOS

type OSImagesByOS map[string]OSImagesByVersion

type OSImagesByVersion

type OSImagesByVersion map[string][]OS

Jump to

Keyboard shortcuts

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