kernel

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "6.1.137"

	DefaultRegistry = "ghcr.io/jingkaihe/matchlock"
)

Variables

View Source
var (
	ErrDownloadKernel  = errors.New("download kernel")
	ErrParseReference  = errors.New("parse reference")
	ErrParsePlatform   = errors.New("parse platform")
	ErrGetDescriptor   = errors.New("get image descriptor")
	ErrGetImage        = errors.New("get image")
	ErrGetLayers       = errors.New("get layers")
	ErrNoLayers        = errors.New("no layers in image")
	ErrUncompressLayer = errors.New("get uncompressed layer")
	ErrCreateDirectory = errors.New("create directory")
	ErrReadLayer       = errors.New("read layer")
	ErrWriteKernel     = errors.New("write kernel")
	ErrRenameKernel    = errors.New("rename kernel")
	ErrCreateFile      = errors.New("create file")
	ErrKernelNotFound  = errors.New("kernel file not found in archive")
)

Functions

func ImageReference

func ImageReference(version string) string

func ParseVersion

func ParseVersion(ref string) string

func ResolveKernelPath

func ResolveKernelPath(ctx context.Context) (string, error)

Types

type Architecture

type Architecture string
const (
	ArchX86_64 Architecture = "x86_64"
	ArchARM64  Architecture = "arm64"
)

func CurrentArch

func CurrentArch() Architecture

func (Architecture) KernelFilename

func (a Architecture) KernelFilename() string

func (Architecture) OCIPlatform

func (a Architecture) OCIPlatform() string

type Manager

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

func NewManager

func NewManager(opts ...Option) *Manager

func (*Manager) CleanCache

func (m *Manager) CleanCache(version string) error

func (*Manager) EnsureKernel

func (m *Manager) EnsureKernel(ctx context.Context, arch Architecture, version string) (string, error)

func (*Manager) KernelPath

func (m *Manager) KernelPath(arch Architecture, version string) string

func (*Manager) ListCachedVersions

func (m *Manager) ListCachedVersions() ([]string, error)

type Option

type Option func(*Manager)

func WithCacheDir

func WithCacheDir(dir string) Option

func WithRegistry

func WithRegistry(registry string) Option

Jump to

Keyboard shortcuts

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