idtools

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package idtools provides helpers for dealing with Linux ID mappings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseMapping

func ParseMapping(spec string) (rspec.LinuxIDMapping, error)

ParseMapping takes a mapping string of the form "container:host[:size]" and returns the corresponding rspec.LinuxIDMapping. An error is returned if not enough fields are provided or are otherwise invalid. The default size is 1.

func ToContainer

func ToContainer(hostID int, idMap []rspec.LinuxIDMapping) (int, error)

ToContainer takes an unmapped host ID and translates it to a remapped container ID using the provided ID mapping. If no mapping is provided, then the mapping is a no-op. If there is no mapping for the given ID an error is returned.

func ToHost

func ToHost(contID int, idMap []rspec.LinuxIDMapping) (int, error)

ToHost translates a remapped container ID to an unmapped host ID using the provided ID mapping. If no mapping is provided, then the mapping is a no-op. If there is no mapping for the given ID an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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