cloudless

package module
v0.0.0-...-923d7aa Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 42 Imported by: 0

README

cloudless

Clouds bring storms.

Documentation

Index

Constants

View Source
const (
	// BaseDir is the directory where all the files are stored.
	BaseDir = "/cloudless"
)

Variables

View Source
var (
	// DefaultKernelModules is the reasonable list of kernel modules providing networking and storage.
	DefaultKernelModules = []kernel.Module{

		{Name: "virtio-net"},

		{Name: "nft-masq"},
		{Name: "nft-nat"},
		{Name: "nft-fib-ipv4"},
		{Name: "nft-ct"},
		{Name: "nft-chain-nat"},

		{Name: "virtio-scsi"},
	}
)

Functions

func AllocateHugePages

func AllocateHugePages(hugePages uint64) host.Configurator

AllocateHugePages allocates huge pages.

func AppDir

func AppDir(name string) string

AppDir returns directory for app-specific data.

func Box

func Box(hostname string, configurators ...host.Configurator) host.Configurator

Box defines system configuration.

func Bridge

func Bridge(ifaceName, mac string, configurators ...InterfaceConfigurator) host.Configurator

Bridge defines bridge interface.

func BuildEFI

func BuildEFI(ctx context.Context, deps types.DepsFunc, config Config) error

BuildEFI builds EFI loader.

func BuildInitramfs

func BuildInitramfs(ctx context.Context, config Config) error

BuildInitramfs builds initramfs.

func BuildKernel

func BuildKernel(ctx context.Context, config Config) error

BuildKernel builds kernel.

func Configuration

func Configuration(cfg *host.SealedConfiguration) host.Configurator

Configuration provides host configuration.

func CreateInitramfs

func CreateInitramfs() host.Configurator

CreateInitramfs creates initramfs file.

func Deployment

func Deployment(configurators ...host.Configurator) []host.Configurator

Deployment converts inlined spec into a slice.

func Destroy

func Destroy(ctx context.Context, libvirtAddr string) error

Destroy destroys dev environment.

func DummyService

func DummyService() host.Configurator

DummyService is used to keep box running without any service.

func Gateway

func Gateway(gateway string) host.Configurator

Gateway defines gateway.

func If

func If(condition bool, configurators ...host.Configurator) host.Configurator

If combines configurators if condition is true.

func ImmediateKernelModules

func ImmediateKernelModules(modules ...kernel.Module) host.Configurator

ImmediateKernelModules load kernel modules immediately.

func IsContainer

func IsContainer() host.Configurator

IsContainer verifies that image is run inside container.

func IsHost

func IsHost() host.Configurator

IsHost verifies that image is run on host.

func Join

func Join(configurators ...host.Configurator) host.Configurator

Join combines many configurator into a single one.

func KernelModules

func KernelModules(modules ...kernel.Module) host.Configurator

KernelModules defines kernel modules to load.

func Main

func Main(deployment ...host.Configurator)

Main is the entrypoint of the init process.

func Metrics

func Metrics(gatherers ...prometheus.Gatherer) host.Configurator

Metrics registers prometheus metric gatherers.

func Mount

func Mount(source, target string, writable bool) host.Configurator

Mount defines mount.

func MountPersistentBase

func MountPersistentBase(dev string) host.Configurator

MountPersistentBase mounts provided block device to the base dir to provide persistency.

func Network

func Network(mac, ifaceName string, configurators ...InterfaceConfigurator) host.Configurator

Network defines network.

func Prepare

func Prepare(prepares ...host.PrepareFn) host.Configurator

Prepare runs system preparation function.

func Prune

func Prune(prunes ...host.PruneFn) host.Configurator

Prune adds decision maker if root directory should be pruned.

func RequireContainers

func RequireContainers(images ...string) host.Configurator

RequireContainers requires container images to be downloaded and cached.

func Route

func Route(destination, gateway string) host.Configurator

Route defines static route.

func Service

func Service(name string, onExit parallel.OnExit, task parallel.Task) host.Configurator

Service starts service.

func Start

func Start(libvirtAddr string, sources ...dev.SpecSource) error

Start starts dev environment.

func StartVirtServices

func StartVirtServices() host.Configurator

StartVirtServices starts virtualization services.

func Stop

func Stop(ctx context.Context, libvirtAddr string) error

Stop stops dev environment.

func Verify

func Verify(ctx context.Context, config Config) error

Verify verifies checksums in config.

Types

type BoxFunc

type BoxFunc func(hostname string, configurators ...host.Configurator) host.Configurator

BoxFunc is the function configuring box.

func BoxFactory

func BoxFactory(configurators ...host.Configurator) BoxFunc

BoxFactory returns box factory with preconfigured components.

func ExtendBoxFactory

func ExtendBoxFactory(boxFunc BoxFunc, configurators ...host.Configurator) BoxFunc

ExtendBoxFactory extends box factory with another sets of configurators.

type Config

type Config struct {
	Input  InputConfig
	Output OutputConfig
	Distro DistroConfig
}

Config is the configuration of loader builder.

type DistroConfig

type DistroConfig struct {
	EFI                  EFI
	Base                 Resource
	KernelPackage        Resource
	KernelModulePackages []Resource
	BtrfsPackages        []Resource
	KernelModules        []string
}

DistroConfig is the configuration of distro builder.

type EFI

type EFI struct {
	Version string
	Hash    string
}

EFI represents source of FI loader.

type InputConfig

type InputConfig struct {
	InitBin string
}

InputConfig stores paths to input files.

type InterfaceConfigurator

type InterfaceConfigurator func(c *host.InterfaceConfig)

InterfaceConfigurator is a type alias for functions that configure a specific network interface.

func IPs

func IPs(ips ...string) InterfaceConfigurator

IPs configures the IP addresses for a network interface.

func Master

func Master(bridge string) InterfaceConfigurator

Master sets the master interface name for a network interface.

type OutputConfig

type OutputConfig struct {
	EFI       string
	Kernel    string
	Initramfs string
}

OutputConfig stores paths to output files.

type Resource

type Resource struct {
	URL  string
	Hash string
}

Resource represents downloadable resource.

Jump to

Keyboard shortcuts

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