identity

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package identity provides manipulating user(+group) identity strings as used in the Docker API for running containers and executing new processes inside containers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithGroup

func WithGroup[I Principal](p string, gid I) string

WithGroup configures the group the command(s) inside a container will be run as, taking either a group name or ID. If an empty group name "" is specified, any configured group name or ID will be removed.

func WithUser

func WithUser[I Principal](id I) string

WithUser configures the user and optionally group the command(s) inside a container will be run as, taking either a user name, user:group names, or a user ID. WithUser will remove any previously configured group, either setting the specified group or configuring no group at all (so that the container image default applies).

Types

type Principal

type Principal interface{ ~string | ~int }

Principal is a string or int value to identify a specific user or group.

Jump to

Keyboard shortcuts

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