Documentation ¶
Index ¶
- Variables
- func NewImageService(ctx context.Context, containerdAddr string, opts ...ImageServiceOpt) (runtime.ImageServiceServer, error)
- func NewSnapshotter(root string, opts ...SnapshotterOpt) (snapshots.Snapshotter, error)
- func Supported(root string) error
- type Config
- type ImageServiceConfig
- type ImageServiceOpt
- type NixBuilder
- type Opt
- type SnapshotterConfig
- type SnapshotterOpt
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotInitialized = errors.New("Nix-snapshotter Image Service not yet initialized")
)
Functions ¶
func NewImageService ¶
func NewImageService(ctx context.Context, containerdAddr string, opts ...ImageServiceOpt) (runtime.ImageServiceServer, error)
func NewSnapshotter ¶
func NewSnapshotter(root string, opts ...SnapshotterOpt) (snapshots.Snapshotter, error)
NewSnapshotter returns a Snapshotter which uses overlayfs. The overlayfs diffs are stored under the provided root. A metadata file is stored under the root.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is used to configure common options.
type ImageServiceConfig ¶
type ImageServiceConfig struct {
Config
}
ImageServiceConfig is used to configure the image service instance.
type ImageServiceOpt ¶
type ImageServiceOpt interface {
SetImageServiceOpt(cfg *ImageServiceConfig)
}
ImageServiceOpt is an option for NewImageService.
type NixBuilder ¶
NixBuilder is a function that is able to substitute a nix store path and optionally create an out-link. outLink may be empty in which case out-links are not needed.
Typically this is implemented by `nix build --out-link ${outLink} ${nixStorePath}`, however it can also be done by `nix copy` and alternate implementations.
func NewExternalBuilder ¶ added in v0.1.2
func NewExternalBuilder(name string) NixBuilder
NewExternalBuilder returns a NixBuilder from an external executable with two arguments: an out-link path, and a Nix store path.
type Opt ¶
type Opt interface { SnapshotterOpt ImageServiceOpt }
Opt is a common option for nix related services.
func WithNixBuilder ¶
func WithNixBuilder(nixBuilder NixBuilder) Opt
WithNixBuilder is an option to override the default NixBuilder.
type SnapshotterConfig ¶
type SnapshotterConfig struct { Config // contains filtered or unexported fields }
SnapshotterConfig is used to configure the nix snapshotter instance.
type SnapshotterOpt ¶
type SnapshotterOpt interface {
SetSnapshotterOpt(sc *SnapshotterConfig)
}
SnapshotterOpt is an option for NewSnapshotter.
func WithFuseOverlayfs ¶
func WithFuseOverlayfs() SnapshotterOpt
WithFuseOverlayfs changes the overlay mount type used to fuse-overlayfs, an FUSE implementation for overlayfs.
func WithOverlayOpts ¶
func WithOverlayOpts(opts ...overlay.Opt) SnapshotterOpt
WithOverlayOpts provides overlay options to the embedded overlay snapshotter.